akka/akka-http

Valid Content-Type header are eaten-up by headerValueByName directive

Offen

#1.011 geöffnet am 04.04.2017

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (598 Forks)batch import
1 - triagedhelp wantedt:docst:routing

Repository-Metriken

Stars
 (1.311 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 10h) (2 gemergte PRs in 30 T)

Beschreibung

It seems that HeaderValueByName, optinalHeaderValueByName and headerValueByType are not returning the content type if it is an valid one.

I posted already something on the mailing list https://groups.google.com/forum/#!topic/akka-user/ZClckCsc8e4

For testing purpose I wrote a small server (to test my client) object WebServer extends HttpApp { def route: Route = path("publishvalid") { optionalHeaderValueByName("Content-Type") { header => println("Content-Type is "+header) post { complete("") } } } }

While doing this I observed that the directive optionalHeaderValueByName was never returning a valid value if the Content-Type I send was valid (I used postman for it). If I used a customized Content-Type it works fine. Observed the same fore headerValueByName and HeaderContentType.

This seems like an bug for me, evenso it is mentioned here http://doc.akka.io/docs/akka-http/10.0.4/scala/http/common/http-model.html#http-model that the Content-Type is treated differntly.

Regards

Wolfgang

Contributor Guide