wajam/nlb — pull request #31 by clementgarnier (2014-01-03 18:36:08+00:00)
Title: Fix Content-Type header on chunked responses

Encoding problems have been reported on large payloads handled by NLB. It appears that the `Content-Type` header was not set on chunked responses.

When transferring HTTP messages from client to server (and vice versa), NLB discards some of the HTTP headers, including `Content-Type`. Spray otherwise ignores these existing headers and sets new headers by itself, generating a warning each time.

In a chunked response, the `Content-Type` header has to be set on the first chunk. Spray sets this header depending on the content of the first chunk. However, when the first chunk is empty, it cannot infer the content-type, and in previous versions of Spray, [it was not allowed to explicitly set the `Content-Type` even in this precise case](https://github.com/spray/spray/issues/543).

Upgrading Spray (thus Akka) and leaving the `Content-Type` header unchanged on `ChunkResponseStart` messages fixed the issue.