zivl / sentry-testkit

A Sentry plugin to allow Sentry report interception and further inspection of the data being sent
https://zivl.github.io/sentry-testkit/
MIT License
112 stars 26 forks source link

Body not parsed #104

Closed rchl closed 2 years ago

rchl commented 2 years ago

This code seems to only parse body for requests with content-type application/json or application/x-sentry-envelope:

https://github.com/wix/sentry-testkit/blob/a210f7389ae414b0cdc707682bfea70f672138a2/src/localServerApi.js#L25

But in practice Sentry seems to be sending payloads with Content-Type: text/plain;charset=UTF-8 header so the payload is not parsed and fails when handling the request:

https://github.com/wix/sentry-testkit/blob/a210f7389ae414b0cdc707682bfea70f672138a2/src/localServerApi.js#L32-L33

zivl commented 2 years ago

I dont see any reason why not expand the type to text/plain. you're welcome to PR!