akka/akka-http

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

开放

#1,011 创建于 2017年4月4日

 (3 条评论) (0 个反应) (0 位负责人)Scala (598 个派生)batch import
1 - triagedhelp wantedt:docst:routing

仓库指标

星标
 (1,311 个星标)
PR 合并指标
 (平均合并 1天 10小时) (30 天内合并 2 个 PR)

描述

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

贡献者指南