Skip to content

Request header unexpectedly mutated #12

@eappel

Description

@eappel

In this example, I'm supplying an uppercased request header but it's getting lowercased somewhere within the parsing library. I couldn't easily figure out where this was happening to fix with a PR so opening as an issue!

enum TestRoute {
    case testing(value: String)
}

let testingRouter = Route(.case(TestRoute.testing)) {
    Path {
        "testing"
    }
    Headers {
        Field("UPPERCASED-HEADER")
    }
}

func test() async throws {
    let request = try testingRouter.request(
        for: TestRoute.testing(value: "VALUE")
    )
    print(request.allHTTPHeaderFields!)
}

printed:
["uppercased-header": "VALUE"]

expected:
["UPPERCASED-HEADER": "VALUE"]

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