mendhak / docker-http-https-echo

Docker image that echoes request data as JSON; listens on HTTP/S, useful for debugging.
https://code.mendhak.com/docker-http-https-echo/
MIT License
621 stars 136 forks source link

Http header case should be preserved. #67

Closed kreiger closed 3 weeks ago

kreiger commented 2 months ago

Currently all headers are lower cased, e.g. Content-Type -> content-type.

I know that headers are case insensitive, but they should be case preserving.

Some faulty servers depend on a certain case and it would be nice to echo back exactly what was sent.

mendhak commented 4 weeks ago

I've pushed a test tag to Docker Hub. It seems that Node does a dedupe, processing, combining and lowercasing of the headers, so it seems to be very much on purpose. In the code I'm doing some matching on the headers in rawHeaders hopefully it mostly matches up.

To test it

docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:issue-67-68
mendhak commented 3 weeks ago

Tag :34 is now pushed to Docker Hub and Github