Skip to content

Commit

Permalink
RED-149 #time 30m Added the flag InstanceFollowRedirects to the UrlCo…
Browse files Browse the repository at this point in the history
…nnection in order to automatically follow the redirection
  • Loading branch information
ludovicroland committed Feb 15, 2017
1 parent 7899ffa commit 82e4aa8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion droid4me/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.8.006-SNAPSHOT
2.4.8.007-SNAPSHOT
2 changes: 1 addition & 1 deletion droid4me/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<groupId>com.smartnsoft</groupId>
<artifactId>droid4me</artifactId>
<name>droid4me</name>
<version>2.4.8.006-SNAPSHOT</version>
<version>2.4.8.007-SNAPSHOT</version>
<packaging>jar</packaging>
<description>droid4me is a framework library dedicated to the development of Android applications.</description>
<url>https://github.com/smartnsoft/droid4me</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@

package com.smartnsoft.droid4me.ws;

import com.smartnsoft.droid4me.log.Logger;
import com.smartnsoft.droid4me.log.LoggerFactory;

import java.io.*;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
Expand All @@ -30,6 +35,9 @@
import java.util.Map;
import java.util.Map.Entry;

import com.smartnsoft.droid4me.log.Logger;
import com.smartnsoft.droid4me.log.LoggerFactory;

/**
* * A basis class for making web service calls easier.
* <p/>
Expand Down Expand Up @@ -350,6 +358,7 @@ private HttpURLConnection performHttpRequest(String uri, CallType callType, Map<
}
}

httpURLConnection.setInstanceFollowRedirects(true);
httpURLConnection.setReadTimeout(getReadTimeout());
httpURLConnection.setConnectTimeout(getConnectTimeout());
httpURLConnection.setDoInput(true);
Expand Down

0 comments on commit 82e4aa8

Please sign in to comment.