playframework / play-ws

Standalone Play WS, an async HTTP client with fluent API
https://www.playframework.com/documentation/latest/JavaWS
Apache License 2.0
223 stars 87 forks source link

Some headers keys in 2.8.1 are in lowercase #448

Open awouda opened 4 years ago

awouda commented 4 years ago

Header names: some in lowercase

We just upgraded our play apps from 2.6.6 to 2.8.1 On our test environments we saw 502 errors coming back from other servers we call via play ws. It seems that the newer version some headers are now in lower case.

Result from test with 2.8.1: POST / HTTP/1.1 Content-Type: text/xml;charset=UTF-8 content-length: 340 host: localhost:9001 accept: */* user-agent: AHC/2.1

result from 2.6.6:

POST / HTTP/1.1 Content-Type: text/xml;charset=UTF-8 Content-Length: 340 Host: localhost:9001 Accept: */* User-Agent: AHC/2.0

Our endpoint broke on the content-length (lowercase) header key. We created a workaround by explicitly setting the header with the key in the right format ("Content-Length"), but as some keys are in lower keys, and I think the RFC mentions them with first letter in uppercase, this might be a bug.

Play WS Version (migrated from 2.6.6 to 2.8.1

We migrated from 2.6.6 to 2.8.1 and encountered above issue.

API (Scala / Java / Neither / Both)

Scala

awouda commented 4 years ago

Just discussed an discovered with a colleague that headers are case insensitive. So it's some internal legacy client that rejects our calls.

However, header names in the 2.8.1 look inconsistent, "Content-Type" is with starting uppercase.