Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ private static class GoogleCloudStorageBlobStoreHttpHandler extends GoogleCloudS
@SuppressForbidden(reason = "this test uses a HttpServer to emulate a Google Cloud Storage endpoint")
private static class GoogleErroneousHttpHandler extends ErroneousHttpHandler {

private static final String IDEMPOTENCY_TOKEN = "x-goog-gcs-idempotency-token";

GoogleErroneousHttpHandler(final HttpHandler delegate, final int maxErrorsPerRequest) {
super(delegate, maxErrorsPerRequest);
}
Expand All @@ -340,6 +342,10 @@ protected String requestUniqueId(HttpExchange exchange) {
}
}

if (exchange.getRequestHeaders().containsKey(IDEMPOTENCY_TOKEN)) {
return exchange.getRequestHeaders().getFirst(IDEMPOTENCY_TOKEN);
}

final String range = exchange.getRequestHeaders().getFirst("Content-Range");
return exchange.getRemoteAddress().getHostString()
+ " "
Expand Down