pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Handling of RFC7540 8.1.2.5 specification

Open juliuskreutz opened this issue 1 year ago • 4 comments

Hi Team,

I would like pingora to follow the RFC7540 8.1.2.5 specification or at least a feature that would allow switching between the old and new specification.

This has become a problem, because a website I'm working on can't handle the old way of parsing cookie headers

// old way
cookie: a=b
cookie: c=d
cookie: e=f
// new way
cookie: a=b; c=d; e=f

The issue lies in the h2 crate. I have mentioned this to the maintainers but they have decided that

The place to implement that is in systems that do provide such things, such as Pingora

Hence why I'm requesting this feature

juliuskreutz avatar Apr 07 '24 12:04 juliuskreutz

Is my understanding correctly that you want a feature that transform the cookie headers in the old format to the new format when the system proxies the traffic to a HTTP/1.1 upstream?

eaufavor avatar Apr 19 '24 15:04 eaufavor

Hi!

I did forget to specify, that this only needs to be done for HTTP/2 upstream. This can be either a feature or standard

juliuskreutz avatar Apr 19 '24 16:04 juliuskreutz

RFC7540 8.1.2.5 only requires this conversion to happen

before being passed into a non-HTTP/2 context

But I do see that this could be an useful feature.

On the other hand, many cloud APIs requires signed URLs, which means that any modification on the request headers could break these API traffic. So if we have such a feature it would be optional and default off.

eaufavor avatar Apr 19 '24 23:04 eaufavor

Yes I agree

such as an HTTP/1.1 connection, or a generic HTTP server application.

Does mean only concatenating the cookie headers, if the context changes. Maybe a feature or flag could be useful to indicate a change of context in a proxy.

And yes, the default should be off.

juliuskreutz avatar Apr 20 '24 03:04 juliuskreutz