Closing prevous connection if redirect (#1314)
CODENVY-538:Closing previous connection if redirect Signed-off-by: Vitaly Parfonov <vparfonov@codenvy.com>6.19.x
parent
cd418b35c6
commit
5e8d7d42d8
|
|
@ -278,7 +278,9 @@ public class IoUtil {
|
|||
if (redirect) {
|
||||
String newUrl = conn.getHeaderField("Location");
|
||||
// open the new connection again
|
||||
http = (HttpURLConnection)new URL(newUrl).openConnection();
|
||||
http.disconnect();
|
||||
conn = new URL(newUrl).openConnection();
|
||||
http = (HttpURLConnection)conn;
|
||||
http.setRequestMethod(HttpMethod.GET);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue