Closed AbelVandenBriel closed 2 years ago
Note: this seems to be a handlersjs issue, not a proxy issue
Edit: Transferred the issue to handlersjs after discovering this.
In the NodeHttpRequestResponseHandler
, a call is made to parseBody
in the handle
function in large pipe
, which will simply attempt to parse the body as JSON. If this fails, an error is thrown and caught in the catchError
rxjs function.
There, we are simply returning an Internal Server Error - ALWAYS. This makes sense in some cases, as crashing in this handler likely means something went wrong internally, but in this case it's just that the JSON body that was claimed to be valid json in the content-type header simply wasn't valid, and we should let the sender know that in a valid error response.
When testing magic links on a local instance of the proxy:
Accidentally included a comment, which obviously is not possible in JSON. However, the resulting response should be a 400 telling me my JSON was wrong, not a 500 internal server error making me think the issue is with the proxy itself:
┆Issue is synchronized with this Wrike task by Unito