vapor/vapor

Return 415 error if compressed request is detected, but not supported

dimitribouniol opened this issue · 0 comments

According to RFC 2616 - 14.11 Content-Encoding:

If the content-coding of an entity in a request message is not acceptable to the origin server, the server SHOULD respond with a status code of 415 (Unsupported Media Type).

More specifically, if request compression is disabled, or a non-supported coding is used, we should return a 415 error. This could live in NIO's NIOHTTPRequestDecompressor, but that wouldn't handle the case where the handler is never attached (aka request decompression is disabled), so we should probably handle it in the DefaultResponder.