markusthoemmes commented on a change in pull request #2676: Change response 
when entity is empty from 200 to 204.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2676#discussion_r136288101
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/controller/WebActions.scala
 ##########
 @@ -216,32 +216,48 @@ protected[core] object WhiskWebActionsApi extends 
Directives {
                 case _ => throw new Throwable("Invalid header")
             } getOrElse List()
 
+            val body = fields.get("body")
+
             val code = fields.get(rp.statusCode).map {
                 case JsNumber(c) =>
                     // the following throws an exception if the code is
                     // not a whole number or a valid code
                     StatusCode.int2StatusCode(c.toIntExact)
 
                 case _ => throw new Throwable("Illegal code")
-            } getOrElse (OK)
+            }
+
+            body map {
+                case JsString(str) =>
 
 Review comment:
   Would it make sense to add the `str.nonEmpty` as a guard and let the rest 
fall through to the default case which is identical to the `else` case here?
 
----------------------------------------------------------------
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