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/03 22:01:58 UTC

[GitHub] duglin commented on issue #2147: Parse `+json` content types suffix for web action bodies

duglin commented on issue #2147: Parse `+json` content types suffix for web action bodies
URL: https://github.com/apache/incubator-openwhisk/issues/2147#issuecomment-386450729
 
 
   I just ran into this today (I think its either the same, or related, issue).  My function is in a docker container and the __ow_body is sometimes base64 encoded and sometimes not based on these two content-type values:
   `application/cloudevents+json`
   `application/cloudevents+json; charset=UTF-8`
   The UTF one is given to me as raw json, while the other one is base64 encoded. IMO both should be raw json. 
   
   Additionally, it would be really nice if there was a flag (perhaps as a header) given to the function so it knows whether the body is base64 encoded or not. While I know it might be possible to look at the content-type and figure it out, you're asking the function to mimic the logic in OW to make that determination and that's not only error prone but could be a lot of work in the case where the function may not actually know about all of the various content-types and its acting more like a pass-thru. It seems like it would be really nice (from a UX) perspective if there was some flag someplace that the function could look at and know (w/o a doubt and w/o a lot of code) whether it needs to decode the body or not.
   
   /cc @csantanapr 

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