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

Fix parsing media types with '.' in them #36

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

patrickbkr
Copy link
Member

Related to #7 and #34

According to RFC 2045:

value := token / quoted-string
token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
            or tspecials>
tspecials :=  "(" / ")" / "<" / ">" / "@" /
              "," / ";" / ":" / "\" / <">
              "/" / "[" / "]" / "?" / "="
              ; Must be in quoted-string,
              ; to use within parameter values

The RFC provides a good-list, while the code gives a bad-list. I didn't go
through the ASCII charset to check whether the two match up. I did notice
that '.' is missing though, because the azure.com API returns dots in
parameters.
RFC 6838 Allows the '.' as a char in parameter values just as well.

According to RFC 2045[1]:

    value := token / quoted-string
    token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                or tspecials>
    tspecials :=  "(" / ")" / "<" / ">" / "@" /
                  "," / ";" / ":" / "\" / <">
                  "/" / "[" / "]" / "?" / "="
                  ; Must be in quoted-string,
                  ; to use within parameter values

The RFC provides a good-list, while the code gives a bad-list. I didn't go
through the ASCII charset to check whether the two match up. I did notice
that '.' is missing though, because the azure.com API returns dots in
parameters.

[1]: https://www.ietf.org/rfc/rfc2045.txt
@jnthn jnthn merged commit cce2e8f into croservices:master Nov 14, 2022
@patrickbkr patrickbkr deleted the dot-in-content-type branch November 15, 2022 08:20
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