OK. I see that Content-Type is modeled into Entity.

But, this is harmful if you try to implement S3-compatible storage because 
its signature calculation depends on Content-Type value on the client side.

With some works it's revealed that akka-http puts versatile 
"application/octet-stream" type if the Content-Type is empty. The 
followings are requests in spray and akka-http with the same test.

spray:
HttpRequest(PUT,http://localhost:8080/mybucket/a/b?AWSAccessKeyId=BCDEFGHIJKLMNOPQRSTA&Expires=1446974354&Signature=UTG4TLzkqJDKi4pWR%2BQ4h6V5JEo%3D,List(Content-Length:
 
14, Host: localhost:8080, Connection: Keep-Alive, User-Agent: 
Apache-HttpClient/4.5.1 (Java/1.8.0_45), Accept-Encoding: gzip, 
deflate),HttpEntity(application/octet-stream,We love Scala!),HTTP/1.1)

akka-http:
HttpRequest(HttpMethod(PUT),http://localhost:9000/mybucket/a/b?AWSAccessKeyId=BCDEFGHIJKLMNOPQRSTA&Expires=1446974407&Signature=jrLVl0YthTkoV9O640or0T533WM%3D,List(Host:
 
localhost:9000, Connection: Keep-Alive, User-Agent: Apache-HttpClient/4.5.1 
(Java/1.8.0_45), Accept-Encoding: gzip, 
deflate),HttpEntity.Strict(application/octet-stream,ByteString(87, 101, 32, 
108, 111, 118, 101, 32, 83, 99, 97, 108, 97, 33)),HttpProtocol(HTTP/1.1))

I think this is kind of bug that akka-http puts octet-stream as the 
Content-Type although the spray puts none on headers. The problem is that 
we can't tell adding octet-stream to Http headers is client's intention or 
not.

I suggest we need a config option that tells akka-http to explicitly copy 
the Content-Type of the received request (from client) to the headers 
member, without any selfish interpretation.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to