hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Replace title-case option with public HeaderCaseMap?

Open seanmonstar opened this issue 3 years ago • 4 comments

This is just a proposal, but if it seems like a good idea, doing it for 1.0 would be a good time, since we can actually remove the old support.

Initially we added support to title-case headers (#2313), which does work in a lot of situations, but it isn't always enough. So then we added partial support for preserving original header case (#2480). If we were to figure out the public API for this extension (#2695), we could remove the http1_header_title_case options.

seanmonstar avatar May 26 '22 23:05 seanmonstar

@nox I think you might have mentioned something like this before in Discord, do you have any opinion?

seanmonstar avatar Aug 08 '22 23:08 seanmonstar

With this, how would we force Hyper to send "Date" instead of "date"?

nox avatar Aug 22 '22 07:08 nox

It could be done the same way as any other header, include an entry for DATE.

seanmonstar avatar Aug 22 '22 16:08 seanmonstar

What about any other header added through middleware tower services etc? IMO we should keep that setting, as it is quite easy to end up with headers that are rejected by some cloud services for being sus

nox avatar Aug 23 '22 08:08 nox

The comment from nox makes sense, without this option, "automatic" headers inside hyper and any headers in middleware could not be customized to certain style if needed. We can always deprecate this in the far future if a better way works someday.

seanmonstar avatar Aug 31 '23 15:08 seanmonstar