Skip to content

Conversation

@diaznet
Copy link

@diaznet diaznet commented Apr 22, 2025

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

  • Unit Test or Example Code
  • Changelog entry

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Diaz Jeremy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

2 participants