Skip to content

Commit

Permalink
fix #4954: disabling jdk expect continue by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins authored and manusa committed Mar 10, 2023
1 parent f64529c commit 13d6dfd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Fix #4931: using coarse grain locking for all mock server operations
* Fix #4947: typo in HttpClient.Factory scoring system logic
* Fix #4928: allows non-okhttp clients to handle invalid status
* Fix #4954: disabling expect continue support by default in the jdk client

#### Improvements
* Fix #4675: adding a fully client side timeout for informer watches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,16 @@ protected void closeHttpClient(JdkHttpClientImpl jdkHttpClientImpl) {
.map(ShutdownableExecutor.class::cast).ifPresent(ShutdownableExecutor::shutdownNow);
}

/**
* Due to go/kubernetes bug https://github.com/golang/go/issues/57824
* expect continue is not supported for jdk. Override this method if you are using a
* kubernetes version with the fix and require this support (currently only used for
* submitting openshift builds)
*
* @return
*/
protected boolean useExpectContinue() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public long contentLength() {
}

requestBuilder.uri(request.uri());
if (request.isExpectContinue()) {
if (request.isExpectContinue() && this.builder.getClientFactory().useExpectContinue()) {
requestBuilder.expectContinue(true);
}
return requestBuilder;
Expand Down

0 comments on commit 13d6dfd

Please sign in to comment.