You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/09/13 03:06:46 UTC

[GitHub] dubeejw commented on issue #2690: content-type header missing in web action headers

dubeejw commented on issue #2690: content-type header missing in web action headers
URL: https://github.com/apache/incubator-openwhisk/issues/2690#issuecomment-329045081
 
 
   After some investigation, I've determined why the content-type value is missing from the headers parameter. Problem being is that the extracted request entity does not contain a content-type value in the headers (akka-http bug?). We can add the content-type to the headers. However, if a content-type was not sent in the request, we need to determine if we want to display a type of `none/none` in the headers or not.
   
   Method where headers parameter is set:
   ```
     private val requestMethodParamsAndPath = {
       extract { ctx =>
         val method = ctx.request.method
         val query = ctx.request.uri.query()
         val path = ctx.unmatchedPath.toString
         val headers = ctx.request.headers
         Context(webApiDirectives, method, headers, path, query)
       }
     }
   ```
   
   Could do something similar to the semantics here to add the content-type:
   ```
   val headers = ctx.request.headers ++ Seq(RawHeader("content-type", ctx.request.entity.contentType.toString))```
   ```
   
   If content-type is not set the result is `none/none`. Should we exclude the header is such a case?
   ```
   {"__ow_method":"get","__ow_headers":{"accept":"*/*","user-agent":"curl/7.54.0","host":"controllers","timeout-access":"<function1>","content-type":"none/none","connection":"close"},"__ow_path":""}
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services