Skip to content

Commit ab08632

Browse files
committed
Reinstate 0 Content-Length
A previous commit removed the Content-Length header from communication with the UAA when negotiating tokens. This change, while working in most instances does break some usage. This change reinstates that header. [resolves #580]
1 parent 2bc51fc commit ab08632

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/tokenprovider/AbstractUaaTokenProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ private Mono<String> getTokenFlow(ConnectionContext connectionContext) {
9595
.map(this::getTokenUri)
9696
.then(uri -> connectionContext.getHttpClient()
9797
.post(uri, outbound -> outbound
98-
.header(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED)
99-
.header(HttpHeaderNames.AUTHORIZATION, getAuthorizationValue())
10098
.header(HttpHeaderNames.ACCEPT, HttpHeaderValues.APPLICATION_JSON)
99+
.header(HttpHeaderNames.AUTHORIZATION, getAuthorizationValue())
100+
.header(HttpHeaderNames.CONTENT_LENGTH, "0")
101+
.header(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED)
101102
.removeTransferEncodingChunked()
102103
.sendHeaders())
103104
.doOnSubscribe(NetworkLogging.post(uri))

0 commit comments

Comments
 (0)