tls-client icon indicating copy to clipboard operation
tls-client copied to clipboard

[Bug]: Automatically making some headers in title case

Open 64chevy opened this issue 6 months ago • 3 comments

TLS client version

1.2

System information

MacOS + Linux

Issue description

The code automatically makes the cookie, content-length, content-type, traceparent headers into title case and I receive 400 error from an api because we have to send the headers in lowercase. Please keep the original formatting of headers.

Steps to reproduce / Code Sample

Sending request to many apis is marked as bad request (error 400) because of automatic title casing.

64chevy avatar Feb 11 '24 01:02 64chevy

@staz9 https://bogdanfinn.gitbook.io/open-source-oasis/tls-client/request-headers#header-key-capitalization

The client will change your header keys to title case when you are providing them all lowercase but using http1. Make sure to use http2 when sending all lowercase header keys

bogdanfinn avatar Feb 12 '24 07:02 bogdanfinn

@staz9 https://bogdanfinn.gitbook.io/open-source-oasis/tls-client/request-headers#header-key-capitalization

The client will change your header keys to title case when you are providing them all lowercase but using http1. Make sure to use http2 when sending all lowercase header keys

Any way to force http2?

AlexPaiva avatar Feb 14 '24 14:02 AlexPaiva

@AlexPaiva it depends on the client profile and the server. It will automatically prefer http2 if your client and the server both supports it.

bogdanfinn avatar Feb 15 '24 08:02 bogdanfinn