akka/akka-http

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

Aberta

#1.011 aberto em 4 de abr. de 2017

 (3 comentários) (0 reação) (0 responsável)Scala (598 forks)batch import
1 - triagedhelp wantedt:docst:routing

Métricas do repositório

Stars
 (1.311 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 10h) (2 fundiu PRs em 30d)

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

Guia do colaborador