You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTTP server currently is calculating Content-Length as a naive
character count, but the header is supposed to be the byte size of the
response contents. In the case of "Hello World", the two are equivalent,
but, if the response contained special characters, the Content-Length
would be incorrect:
```swift
print("moose".characters.count) // 5
print("møøse".characters.count) // 5
print("møøse".utf8.count) // 7
```
For semantic reasons, and for people who are copying the source to serve
their own custom responses, we should provide the correct byte length.
Signed-off-by: David Celis <[email protected]>
0 commit comments