cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.28k stars 1.1k forks source link

Handling of RFC7540 8.1.2.5 specification #189

Open juliuskreutz opened 2 months ago

juliuskreutz commented 2 months ago

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

eaufavor commented 2 months ago

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?

juliuskreutz commented 2 months ago

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

eaufavor commented 2 months ago

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.

juliuskreutz commented 2 months ago

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.