Skip to content

Add unsafe initialisers for HTTPField and HTTPField.Name #56

@adam-fowler

Description

@adam-fowler

Currently when constructing an HTTPField or HTTPField.Name the values are checked to see if they are valid. This is the correct thing to do obviously when the source of the headers is unknown, but if we know in advance the headers are valid this is wasted effort.

The situation I am describing comes from building a SwiftNIO server which has constructed the header values via LLHTTP which validates they are correct and then we build a HTTPField from these that does the validation again.

Is there an argument for providing an unsafe initialiser for both HTTPField and HTTPField.Name to avoid this duplicate work

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions