-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #11659 - Properly ignore OWS before field values. #11661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the wrong fix. The parser itself is meant to skip OWS, so the convertContentLength method should never see any such characters.
We need to investigate why the state machine in parseFields is not working correctly rather than cover up the problem afterwards
The problem looks to be an issue with the handling of a cached header look ahead. investigating.... |
It was broken by #10308,which changed HttpField so that the value could never be @sbordet Do you remember why you did that? There is a difference between a The fix is either to revert this change OR to update Also it is a little bit of a worry that our tests didn't detect this. I think we need a better tests for OWS that cover: cached header; cached header with no value; cached header with unknown value; cached header and value. |
@gregw Since it was the majority of the cases, and HTTP really does not have any meaning for a null value (it can only be the empty string), the change was made. I think it would be better to change |
@joakime perhaps it would be best to create the cache with a special sentinel value for the header only cases so that value not set can be distinguished from a empty string value. |
Content-Length
value.
Update HttpParser.CACHE to handle UNMATCHED_VALUE scenarios (like
Content-Length: 10
) by restoring Jetty 9/10/11 behavior of header only matches from CACHE, allowingHttpParser.parseFields()
to handle OWS properly.Fixes #11659