Skip to content

Commit

Permalink
Revert "Handle header lists in URLConnection client (aws#4897)" (aws#…
Browse files Browse the repository at this point in the history
…4960)

This reverts commit b51a51c. This change may be causing issues with propagation of trace IDs.
  • Loading branch information
millems authored Feb 23, 2024
1 parent 4de1e05 commit e715bb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public String clientName() {
private HttpURLConnection createAndConfigureConnection(HttpExecuteRequest request) {
SdkHttpRequest sdkHttpRequest = request.httpRequest();
HttpURLConnection connection = connectionFactory.createConnection(sdkHttpRequest.getUri());
setHeaders(connection, sdkHttpRequest);
sdkHttpRequest.forEachHeader((key, values) -> values.forEach(value -> connection.setRequestProperty(key, value)));

// connection.setRequestProperty("Transfer-Encoding", "chunked") does not work, i.e., property does not get set
if (sdkHttpRequest.matchingHeaders("Transfer-Encoding").contains("chunked")) {
Expand Down Expand Up @@ -180,13 +180,6 @@ private HttpURLConnection createAndConfigureConnection(HttpExecuteRequest reques
return connection;
}

private void setHeaders(HttpURLConnection connection, SdkHttpRequest request) {
request.forEachHeader((name, values) -> {
String commaSeparated = String.join(",", values);
connection.addRequestProperty(name, commaSeparated);
});
}

private HttpURLConnection createDefaultConnection(URI uri, SSLSocketFactory socketFactory) {

Optional<Proxy> proxy = determineProxy(uri);
Expand Down

This file was deleted.

0 comments on commit e715bb6

Please sign in to comment.