Http.swift icon indicating copy to clipboard operation
Http.swift copied to clipboard

Headers are case-sensitive

Open danpalmer opened this issue 2 years ago • 2 comments

In HTTP, headers are case in-sensitive, however Http.swift treats them as case-sensitive.

This means, for example, when sending a POST to an Http.swift server with a content-length header, no body is read because Http.swift looks for Content-Length. Many clients, including fetch, use lower-case header names.

danpalmer avatar Oct 09 '22 22:10 danpalmer

Hello, that's unfortunately right. I missed the case sensitivity part from rfc. I have no workarounds to provide. You can try other swift http server libraries in the ecosystem.

OrkhanAlikhanov avatar Oct 10 '22 10:10 OrkhanAlikhanov

Thanks for taking a look. I ended up moving to Vapor, but for a small embedded server in a bigger app it's very heavy-weight and not well suited. I think there's a place for a smaller and lighterweight library like this in the ecosystem :)

danpalmer avatar Oct 15 '22 16:10 danpalmer