-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posts as x-www-form-urlencoded don't work #7
Comments
Thanks for the write up! I'll take a look into this as soon as possible and will post you with an update and a solution... :-) The thing with the form-encoded payload in webhook at the moment is that you can only get values of the passed variables, in your case being payload variable with the JSON payload. So basically you can pass that JSON string to your script and then parse it inside and extract the values you are interested in. I will see what modifications can I incorporate into webhook to make it easier for this scenario... |
I'm thinking about adding a property on the hook named |
So as an example, I could define {
"match": {
"type": "value",
"parameters": {
"source": "payload",
"name": "mypayload.commits.0.branch"
},
"value": "needle"
}
} I like the idea. However, |
Exactly that. Maybe |
I'll get this done tonight. |
Success!! |
Awesome! :-) |
First off, thanks for publishing this project. It looks promising.
I ran into an issue trying to receive a POST hook from Bitbucket. Bitbucket sends a x-www-form-urlencoded POST with the JSON content in the
payload
form variable -- they don't send the JSON payload in the body. I was able to modifyhookHandler()
to decode the JSON, but I had to hardcode thepayload
map index:With that change, I'm able to match simple paths (
canon_url
andrepository.absolute_url
), but I'm unable to matchcommits.0.branch
. I've yet to look into why.I'm testing webhook with curl and sending Bitbucket's sample payload. Here's a simplified version of what I'm doing:
I wanted to see if you can duplicate the form decoding problem. I also wanted to see what you think about adding another option to the hook definition format. I'm thinking something like
form-variable
would work. I would set that topayload
, and webhook would know to access that form variable to find the JSON payload.The text was updated successfully, but these errors were encountered: