Skip to content

[BUG] Header is ignoring ISO-8859-1 and using UTF-8 #255

Open
@martinvuyk

Description

@martinvuyk

Describe the bug
Read this article

To Reproduce
Send any ISO-8859-1 character as header and it will be parsed as UTF-8 directly.

Write any Header to a response that contains multi-byte UTF-8 and it will write that sequence instead of:

  • parse to ISO-8859-1
    • when not possible
      • use percent-encoding
      • or outright fail.

Note:
I would like to add this kind of functionality to StringSlice in the stdlib eventually. But you might want to at least add some safety mechanisms in the mean time, invalid UTF-8 can cause segfaults in the stdlib code (I added some debug_asserts and am working on utf8 validation in debug mode as well).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions