hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Add HTTP1 server config for allowing multiple spaces in parsing

Open heiwais25 opened this issue 4 months ago • 6 comments

Is your feature request related to a problem? Please describe.

We have a situation that we want to allow request to have multi spaces as a request line delimiter.

However, I found that the parser config for server is not exposed to the server builder unlike client.

Because of this, there is no way to use Hyper server to support those use case even though httparse crate has a flag for that feature.

Describe the solution you'd like

Expose the parser config in the similar way as Hyper Client.

As it will be configurable in the builder, it will not break other existing server behavior.

Client side example code: https://code.amazon.com/packages/S3DataEngineHyper/blobs/62a7a6badaba2858361fdc633727a97aed4c8853/--/src/client/conn/http1.rs#L350

Describe alternatives you've considered

  1. Update the httparse crate default configuration, but this will break the backward compatibility
  2. Expose ParserConfig itself to the Builder. However, this will make Hyper user to have coupling with httparse config

Additional context Add any other context or screenshots about the feature request here.

heiwais25 avatar Jul 31 '25 21:07 heiwais25

Assuming you mean add configuration methods to the server http1::Builder for those options, definitely!

seanmonstar avatar Aug 01 '25 18:08 seanmonstar

This was resolved by #3929 so I presume we can close it?

magurotuna avatar Dec 07 '25 05:12 magurotuna

Sorry for late. I double checked and found the ask was to expose this feature for the server.

https://github.com/hyperium/hyper/blob/1c70fab64e90f90025eab364beda927044e356fc/src/proto/h1/role.rs#L165

The change was about enhancing h1_parser_config, and found it is not actually used by Server implementation. It is used by Client only.

Please correct me if I'm wrong.

heiwais25 avatar Dec 08 '25 17:12 heiwais25

I believe we need to reopen the ticket again unless I missed the implementation for Server.

We can do like using match ctx.h1_parser_config.parse_request~~() with the default config used currently

I was occupied with others, but now I have some time. Let me create a PR for this.

heiwais25 avatar Dec 08 '25 17:12 heiwais25

Ah, I see. So the builder method was added to the public API, but the parser doesn't yet use that config.

seanmonstar avatar Dec 08 '25 19:12 seanmonstar

Yes, that's correct.

heiwais25 avatar Dec 08 '25 20:12 heiwais25