Skip to content

Commit 2d21cf5

Browse files
committed
Revert "fix: redirects to include the original request headers, mainly authorization"
This reverts commit f9d21f9.
1 parent f9d21f9 commit 2d21cf5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/main/java/com/browserstack/client/BrowserStackRequest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import com.browserstack.client.exception.BrowserStackObjectNotFound;
66
import com.fasterxml.jackson.databind.node.ArrayNode;
77
import com.fasterxml.jackson.databind.node.ObjectNode;
8-
import com.google.api.client.http.*;
8+
import com.google.api.client.http.HttpContent;
9+
import com.google.api.client.http.HttpRequest;
10+
import com.google.api.client.http.HttpResponse;
11+
import com.google.api.client.http.UrlEncodedContent;
912
import com.google.api.client.util.escape.CharEscapers;
1013

1114
import java.io.ByteArrayOutputStream;
@@ -29,8 +32,6 @@ public BrowserStackRequest(HttpRequest httpRequest) {
2932

3033
this.httpRequest = httpRequest;
3134
this.httpRequest.getHeaders().setUserAgent(USER_AGENT);
32-
this.httpRequest.setFollowRedirects(false);
33-
this.httpRequest.setThrowExceptionOnExecuteError(false);
3435
}
3536

3637
private static String getRawBody(InputStream inputStream) throws IOException {
@@ -151,11 +152,6 @@ private HttpResponse execute() throws BrowserStackException, IOException {
151152

152153
case 404:
153154
throw new BrowserStackObjectNotFound(response.parseAsString());
154-
155-
case 302:
156-
String redirectLocation = httpRequest.getResponseHeaders().getLocation();
157-
httpRequest.setUrl(new GenericUrl(httpRequest.getUrl().toURL(redirectLocation)));
158-
response = httpRequest.execute();
159155
}
160156
}
161157

0 commit comments

Comments
 (0)