markusthoemmes commented on a change in pull request #2577: Support multiple 
response header values in raw web actions
URL: 
https://github.com/apache/incubator-openwhisk/pull/2577#discussion_r131518072
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/controller/WebActions.scala
 ##########
 @@ -216,11 +216,8 @@ protected[core] object WhiskWebActionsApi extends 
Directives {
             val JsObject(fields) = result
             val headers = fields.get("headers").map {
                 case JsObject(hs) => hs.map {
-                    case (k, JsString(v))  => RawHeader(k, v)
-                    case (k, JsBoolean(v)) => RawHeader(k, v.toString)
-                    case (k, JsNumber(v))  => RawHeader(k, v.toString)
-                    case _                 => throw new Throwable("Invalid 
header")
-                }.toList
+                    case (k, v) => headersFromJson(k, v)
+                }.flatten.toList
 
 Review comment:
   You should be able to use `flatMap` above to omit the extra `flatten`
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to