Skip to content

Commit 2ead2a8

Browse files
committed
Header name case is preserved for HTTP1.1 only
1 parent 42de260 commit 2ead2a8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ By default, the headers in the response body are lowercased. To attempt to prese
328328
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:41
329329
```
330330

331+
> **Note:** This only has an effect over HTTP/1.1. HTTP/2 requires all header names be lowercase.
332+
331333
## Override the response body with a file
332334

333335
To override the response body with a file, set the environment variable `OVERRIDE_RESPONSE_BODY_FILE_PATH` to a file path.

‎tests.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ message " Start container with PRESERVE_HEADER_CASE enabled "
706706
docker run -d -e PRESERVE_HEADER_CASE=true --rm --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:testing
707707
wait_for_ready
708708

709-
HEADER_CASE_CHECK=$(curl -s -H "prEseRVe-CaSE: A1b2C3" -H 'x-a-b: 999' -H 'X-a-B: 13' localhost:8080 | jq -r '.headers."prEseRVe-CaSE"')
709+
HEADER_CASE_CHECK=$(curl -s --http1.1 -H "prEseRVe-CaSE: A1b2C3" -H 'x-a-b: 999' -H 'X-a-B: 13' localhost:8080 | jq -r '.headers."prEseRVe-CaSE"')
710710
if [[ "$HEADER_CASE_CHECK" == "A1b2C3" ]]
711711
then
712712
passed "PRESERVE_HEADER_CASE enabled"

0 commit comments

Comments
 (0)