openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

On using feeds, the whitespaces in triggers and namespaces should be escaped with %20

Open cbickel opened this issue 10 years ago • 2 comments

I received a question from a user with a problem using OpenWhisk. First the user did a packagebinding with wsk package bind /whisk.system/github myGit --param username myGitUser --param repository myGitRepo --param accessToken mytoken. After that the user created the following trigger: wsk trigger create myGitTrigger --feed myGit/webhook --param events push Everything worked so far. But github wasn't able to fire the trigger on whisk, because there is a whitespace character in the namespace of the user. Github tried to fire the trigger without the whitespace.

After a little research, the problem is in webhook.js. The callback-URL is built with params.triggername. The callback-URL, that is sent to github also includes the whitespace, but github leaves this whitespace away.

I think it would be no problem, fixing this in webhook.js directly, but I want to ask, if it would be better, if params.triggername also escapes the whitespaces with %20. The reason why I ask is: I think other feeds will have the same problem as well.

cbickel avatar Jun 14 '16 17:06 cbickel

When using HTTP, every client has to make sure to always send urlencoded parts in their URL. I'ld suggest to fix this in webhook.js as it is essentially the client. Passing a urlencoded name to a feed not using HTTP as its backend connection might induce strange problem aswell.

markusthoemmes avatar Jun 14 '16 17:06 markusthoemmes

This is fix now https://github.com/openwhisk/openwhisk-catalog/blob/master/packages/github/webhook.js#L34

cc @bjustin-ibm

csantanapr avatar Oct 21 '16 13:10 csantanapr