Update DEMISTO_HTTP_HEADERS_REGEX_PATTERN to handle Cookie headers #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Ready
Related Issues
fixes: n/a
Description
In the current implementation of DEMISTO_HTTP_HEADERS_REGEX_PATTERN it is not possible to pass 'Cookie: ' headers.
'Cookie' headers are usually passed in the following forms in a HTTP request:
One-liner:
Cookie: key1=value; key2=value;
If one wants to pass this as a header in DEMISTO_HTTP_HEADERS_REGEX_PATTERN it should translate to
Cookie=key1=value; key2=value;
This is invalid with the current regex, because of white spaces and multiple '=' signs.
Multi-Liner:
Cookie: key1=value Cookie: key2=value
If one wants to pass this as a header in DEMISTO_HTTP_HEADERS_REGEX_PATTERN it should translate to
Cookie=key1=value,Cookie=key2=value
This is also invalid with the current regex, because of multiple '=' signs.
My proposal with this merge proposal is to update the regex to handle the multi-liner case without breaking current behavior.
The updated regex handles specifically "Cookie" headers.
Must have