Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

header object is constructed with things that aren't valid headers #703

Closed
karenetheridge opened this issue Jan 5, 2024 · 2 comments
Closed

Comments

@karenetheridge
Copy link
Contributor

karenetheridge commented Jan 5, 2024

This can happen when processing a multipart request body, because HTTP::Entity::Parser::MultiPart does push @{$env->{'http.entity.parser.multipart.tempdir'}}, $dir; (where $dir is a File::Temp::Dir object).

..and then, Plack::Request constructs its headers by extracting content from $env, but it doesn't omit keys matching /./ (which aren't valid headers).

This manifested itself in my $work application via fluentd, which logs request headers, only in this case it encountered something that wasn't a string, therefore the middleware threw an exception (in Fluent::Logger and Data::MessagePack).

We'll fix it on our end by omitting headers with dots in them, but I think Plack::Request should do the same.

@karenetheridge
Copy link
Contributor Author

thank you!

@miyagawa
Copy link
Member

miyagawa commented Jan 5, 2024

Thanks. Fixed in 1.0051.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants