Skip to content

Commit 6af874b

Browse files
BenWhiteheadDhriti Chopra
authored andcommitted
fix: call response.disconnect() after resolving resumable upload url (#3385)
1 parent de8dc78 commit 6af874b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,9 @@ public String open(StorageObject object, Map<Option, ?> options) {
11561156
if (response.getStatusCode() != 200) {
11571157
throw buildStorageException(response.getStatusCode(), response.getStatusMessage());
11581158
}
1159-
return response.getHeaders().getLocation();
1159+
String location = response.getHeaders().getLocation();
1160+
response.disconnect();
1161+
return location;
11601162
} catch (IOException ex) {
11611163
span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage()));
11621164
throw translate(ex);
@@ -1190,7 +1192,9 @@ public String open(String signedURL) {
11901192
if (response.getStatusCode() != 201) {
11911193
throw buildStorageException(response.getStatusCode(), response.getStatusMessage());
11921194
}
1193-
return response.getHeaders().getLocation();
1195+
String location = response.getHeaders().getLocation();
1196+
response.disconnect();
1197+
return location;
11941198
} catch (IOException ex) {
11951199
span.setStatus(Status.UNKNOWN.withDescription(ex.getMessage()));
11961200
throw translate(ex);

0 commit comments

Comments
 (0)