Request headers size limit

26 views
Skip to first unread message

Javier Vazquez

unread,
Jul 26, 2018, 7:09:49 PM7/26/18
to envoy-users
Hello,

I'm trying to hit an endpoint with a very long url (query parameters can accept thousands of ids). After some investigation, I see in Envoy's code a hard limit set to 60K (https://github.com/envoyproxy/envoy/blob/f3b110091c0a0e1ae3abd4ce245d57296e1e868d/source/common/http/conn_manager_impl.cc#L543).  

This is inline with my tests, if I go beyond 60Kb I get back a HTTP 431.
 
Are there any plans to make this configurable or is a hard limit based on the libraries used Envoy?


Thanks,
Javier Vazquez



Matt Klein

unread,
Jul 26, 2018, 7:25:32 PM7/26/18
to Javier Vazquez, Envoy Users
HTTP/1.1 has a hard limit imposed by http_parser which might be configurable with a compile define (not sure) but would definitely require an Envoy recompile. HTTP/2 we could easily make configurable. I would open an issue to track.

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users...@googlegroups.com.
To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/c3dd8965-26f0-4179-a1d4-42182a47878f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Javier Vazquez

unread,
Aug 1, 2018, 8:29:29 PM8/1/18
to envoy-users
Matt, thanks for the info.

Sorry for this n00b question but I haven't coded C++ in a very long time. I tried a quick test to increase HTTP/1.1 limit by overriding the max value with a define macro but it didn't pickup the change.

Steps:
1) Override http_parser library max header size by adding "#define HTTP_MAX_HEADER_SIZE (128*1024)" @ https://github.com/envoyproxy/envoy/blob/f3b110091c0a0e1ae3abd4ce245d57296e1e868d/source/common/http/http1/codec_impl.h#L2
3) Recompile

Result:
EnvoyProxy's limit is 80KB (http_parser library default), not the 100KB limit expected.  


Additional Info:


Any ideas?

Thanks,
Javier

Matt Klein

unread,
Aug 2, 2018, 12:39:56 PM8/2/18
to Javier Vazquez, Envoy Users
That define change won't change the value when http_parser itself is compiled. Try the following:
1) Fork http_parser
2) Change the value
4) Recompile

And that should work.


For more options, visit https://groups.google.com/d/optout.

Javier Vazquez

unread,
Aug 2, 2018, 4:33:39 PM8/2/18
to envoy-users
Thanks, it worked like a charm!
Reply all
Reply to author
Forward
0 new messages