You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/05/04 13:37:37 UTC

[GitHub] jcrossley3 commented on a change in pull request #3609: Support "+json" content-types as WebAction input.

jcrossley3 commented on a change in pull request #3609: Support "+json" content-types as WebAction input.
URL: https://github.com/apache/incubator-openwhisk/pull/3609#discussion_r186084086
 
 

 ##########
 File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala
 ##########
 @@ -574,7 +570,7 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc
         case Empty =>
           process(None, isRawHttpAction)
 
-        case HttpEntity.Strict(ContentTypes.`application/json`, json) if !isRawHttpAction =>
+        case HttpEntity.Strict(ct, json) if WhiskWebActionsApi.isJsonFamily(ct.mediaType) && !isRawHttpAction =>
 
 Review comment:
   How does this relate to the `customRejectionHandler` defined in `BasicHttpService`? I'm still unclear on the benefit of checking the content-type at all. Why not simply assume that all payloads are json regardless of content-type and return `HTTP 415 Unsupported Media Type` (with useful logging) in the event of a parse error?

----------------------------------------------------------------
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