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

[3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) #122610

Merged
merged 1 commit into from
Sep 4, 2024

Commits on Aug 2, 2024

  1. [3.9] pythongh-121650: Encode newlines in headers, and verify headers…

    … are sound (pythonGH-122233)
    
    Per RFC 2047:
    
    > [...] these encoding schemes allow the
    > encoding of arbitrary octet values, mail readers that implement this
    > decoding should also ensure that display of the decoded data on the
    > recipient's terminal will not cause unwanted side-effects
    
    It seems that the "quoted-word" scheme is a valid way to include
    a newline character in a header value, just like we already allow
    undecodable bytes or control characters.
    They do need to be properly quoted when serialized to text, though.
    
    This should fail for custom fold() implementations that aren't careful
    about newlines.
    
    (cherry picked from commit 0976339)
    
    Co-authored-by: Petr Viktorin <[email protected]>
    Co-authored-by: Bas Bloemsaat <[email protected]>
    Co-authored-by: Serhiy Storchaka <[email protected]>
    3 people authored and ambv committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    79d7b6f View commit details
    Browse the repository at this point in the history