You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
curl: (55) Failed sending HTTP request when trying to send a request with large header size. >8.1.2 #11405
Hi, I am not certain this is a bug, perhaps this was mentioned somewhere, however, I did not discover it, looking at the changelog.
After updating curl from 8.0.1 I have started seeing requests failing to be sent. Further investigation showed, that this is only happening for requests with large header size (10K characters)
I did this
Send a request with large header size. Example: curl -X GET -L -H "MyHeader: $(printf '%*s' 10000 | tr ' ' 'A')" https://postman-echo.com/get
This is working ok on 8.0.1, but not on 8.1.2.
8.1.2 is returning curl: (55) Failed sending HTTP request
I have discovered this, as libcurl is a downstream dependency of a library that I use in (ethon)
It is a real life usecase, had to adjust what is being sent with the header. The limit I keep in mind always is one from aws alb - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html
That would be a little over 15k characters.
I understand this might be quite the edge case, just wanted to bring this to attention, also in case somebody starts getting the error after updating from 8.0.1.
A number of popular web servers support up to 16KB headers (a few support even longer), so 16KB is probably a reasonable limit (if libcurl needs to limit them at all).
Thanks. I made #11407 just now which overcomes these limitations.
Curl internally has a general buffer limited to 1MB for assembling a HTTP request. This limit is now also in effect for HTTP/2 and HTTP/3 request processing with this PR.
Activity
dfandrich commentedon Jul 6, 2023
icing commentedon Jul 6, 2023
That seems likely. I assume you see different behaviour when adding
--http1.1?dm-boiko commentedon Jul 6, 2023
@icing yes, adding that is fixing the issue.
As visible on the screenshot,
nghttp2is different in those versions. So it's only happening with HTTP2.icing commentedon Jul 6, 2023
We introduced a limit when we refactored the http2 code. Most servers I know have a limit on header length to protect themselves from malicious input.
Is this an experiment you are running or do you have a use case for such headers? If yes, what is the limit you are looking for?
dm-boiko commentedon Jul 6, 2023
I have discovered this, as libcurl is a downstream dependency of a library that I use in (ethon)
It is a real life usecase, had to adjust what is being sent with the header. The limit I keep in mind always is one from aws alb - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html
That would be a little over 15k characters.
I understand this might be quite the edge case, just wanted to bring this to attention, also in case somebody starts getting the error after updating from 8.0.1.
dfandrich commentedon Jul 6, 2023
HTTP/2, raise header limitations above and beyond
icing commentedon Jul 7, 2023
Thanks. I made #11407 just now which overcomes these limitations.
Curl internally has a general buffer limited to 1MB for assembling a HTTP request. This limit is now also in effect for HTTP/2 and HTTP/3 request processing with this PR.
dm-boiko commentedon Jul 9, 2023
Thank you!
http2: raise header limitations above and beyond
http2: raise header limitations above and beyond
http2: raise header limitations above and beyond