swift-http-types
swift-http-types copied to clipboard
Add unsafe initialisers for HTTPField and HTTPField.Name
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