akka/akka-http

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

Ouverte

#1 011 ouverte le 4 avr. 2017

 (3 commentaires) (0 réaction) (0 personne assignée)Scala (598 forks)batch import
1 - triagedhelp wantedt:docst:routing

Métriques du dépôt

Stars
 (1 311 étoiles)
Métriques de merge PR
 (Merge moyen 1j 10h) (2 PRs mergées en 30 j)

Description

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

Guide contributeur