Skip to content
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

Pattern now matches fields with hyphens #17

Merged
merged 1 commit into from
Nov 6, 2020
Merged

Pattern now matches fields with hyphens #17

merged 1 commit into from
Nov 6, 2020

Conversation

gudzpoz
Copy link
Contributor

@gudzpoz gudzpoz commented Nov 6, 2020

The original pattern would miss fields like 'content-length', which is used in Pleroma's signature.

However, when I went to check https://tools.ietf.org/html/rfc7230:

     header-field   = field-name ":" OWS field-value OWS

     field-name     = token
     token          = 1*tchar

     tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
                    / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
                    / DIGIT / ALPHA
                    ; any VCHAR, except delimiters

it seems that the pattern could be further extended.
( But I do think that all headers nowadays will match [\w\s-] anyway :P )

The original pattern will miss fields like 'content-length', which is used in Pleroma's signature.
Copy link
Owner

@landrok landrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Nice catch

I'll add a test to enforce that

@landrok landrok merged commit 0b98689 into landrok:master Nov 6, 2020
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