sentry-webhooks icon indicating copy to clipboard operation
sentry-webhooks copied to clipboard

JS not able to parse simplejson dump payload

Open YashishDua opened this issue 6 years ago • 7 comments
trafficstars

I explored that this webhook sends data after encoding it using simplejson. Since nothing similar to simplejson exist in JS, it's difficult to decode back to original JSON format. How to go on this?

Either encode in a scheme which could be reversed using standard packages or don't encode it (which could not be the case of course) My team urgently needs to fix this, any help would be appreciated.

YashishDua avatar Apr 05 '19 14:04 YashishDua

Is the payload you're getting valid JSON? Why can't it be parsed?

markstory avatar Apr 05 '19 14:04 markstory

No it's not a valid json.

YashishDua avatar Apr 09 '19 18:04 YashishDua

Can you give me an example of something that isn't valid JSON? If that's the case, that's extremely bizarre. simplejson just happens to be a library that implements JSON. It's not it's own flavor or variant of JSON. I've never seen anything from our API or webhooks that aren't JSON compatible. Considering our API is entirely consumed by our frontend JavaScript without any tricks.

mattrobenolt avatar Apr 09 '19 18:04 mattrobenolt

Also, this repository isn't really used anymore and is super old. Everything regarding webhooks is in Sentry core.

mattrobenolt avatar Apr 09 '19 18:04 mattrobenolt

A payload which we are getting via webhook contains body inside single quotes and the content inside these single quotes must be a valid JSON which is not. Node js JSON.parse() gives error while parsing it.

YashishDua avatar Apr 09 '19 18:04 YashishDua

Can you provide an example? Really hard to tell without an example.

mattrobenolt avatar Apr 09 '19 18:04 mattrobenolt

Yes, your email id? It's our internal payload.

YashishDua avatar Apr 10 '19 17:04 YashishDua