Closed elrandira closed 1 year ago
I worked around this by parsing the whole payload string. payload is defined as JSONPath $.payload[0]
I compare then $payload to .*\"ref\":\"refs\\/heads\\/master\".*
not pretty but it works
The problem is not in this plugin, it is on the sender side.
The body:
{
"payload": [
"{\"ref\":\"refs\\/heads\\/master\",\"after\":\"ee311c46a7df88f01aa7a8d35984b1fe89bd3d20\",\"before\":\"f03bec6afe3af8de2a75210eaaa6e5a51370773f\",\"repository\":{\"id\":4765,\"name\":\"robotframework\",\"full_name\":\"robotframework\"},\"pusher\":{\"name\":\"lpinson\",\"email\":\"<redacted>\"},\"sender\":{\"id\":841,\"uri\":\"users\\/841\",\"user_url\":\"\\/users\\/lpinson\",\"real_name\":\"lpinson\",\"display_name\":\"lpinson (lpinson)\",\"username\":\"lpinson\",\"ldap_id\":\"lpinson\",\"avatar_url\":"<redacted>",\"is_anonymous\":false,\"has_avatar\":true}}"
]
}
I being sent as x-www-form-urlencoded
and what you see in the log is the decoded value.
Seems strange to wrap the json within payload
attribute, but not much to do about that here on the receiver side.
That's what I feared. I'll try to dig into the code since Tuleap is open source. Thanks for the feedback Tomas
{ "payload": [ "{\"ref\":\"refs\/heads\/master\",\"after\":\"ee311c46a7df88f01aa7a8d35984b1fe89bd3d20\",\"before\":\"f03bec6afe3af8de2a75210eaaa6e5a51370773f\",\"repository\":{\"id\":4765,\"name\":\"robotframework\",\"full_name\":\"robotframework\"},\"pusher\":{\"name\":\"lpinson\",\"email\":\"\"},\"sender\":{\"id\":841,\"uri\":\"users\/841\",\"user_url\":\"\/users\/lpinson\",\"real_name\":\"lpinson\",\"display_name\":\"lpinson (lpinson)\",\"username\":\"lpinson\",\"ldap_id\":\"lpinson\",\"avatar_url\":"",\"is_anonymous\":false,\"has_avatar\":true}}"
]
}
Contributing variables: