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/18 08:04:53 UTC

[GitHub] markusthoemmes commented on a change in pull request #2766: Remove synthetic header.

markusthoemmes commented on a change in pull request #2766: Remove synthetic header.
URL: https://github.com/apache/incubator-openwhisk/pull/2766#discussion_r139356483
 
 

 ##########
 File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala
 ##########
 @@ -108,7 +109,11 @@ private case class Context(propertyMap: WebApiDirectives,
   def metadata(user: Option[Identity]): Map[String, JsValue] = {
     Map(
       propertyMap.method -> method.value.toLowerCase.toJson,
-      propertyMap.headers -> headers.map(h => h.lowercaseName -> h.value).toMap.toJson,
+      propertyMap.headers -> headers
+        .filter(_.name != `Timeout-Access`.name)
+        .map(h => h.lowercaseName -> h.value)
 
 Review comment:
   Scala tip: To iterate only once you can use `collect` to do a `filter`/`map` in one step:
   
   ```scala
   headers.collect { 
     case h if h.name != `Timeout-Access`.name => 
       h.lowercaseName -> h.value
   }
   ```
 
----------------------------------------------------------------
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