Closed woodardj closed 8 years ago
Parse Server doesn't use csrf, and the stack traces you posted are in the csurf
module so I don't think this is caused by Parse Server. There may be some conflict in the request format used by csurf and Parse Server though.
Roger that, thanks @drew-gross -- given that parse-server doesn't use csrf, does it smell like a middleware-ordering issue to you? Ie: the csurf stuff I'm using to protect the endpoints defined in my express app is interrupting the query (ultimately made via REST back the server, if I'm remembering correctly?). But it sounds like you're saying that the csurf module I'm including is being (incorrectly) invoked when requests are made against Parse Server's endpoints?
That sounds plausible but without being familiar with csurf I can't say for sure.
I've got a set of routes that were previously served up by Cloud Code, but wrap the Parse calls in a REST API that I use to publicly pull data for a website and other places where I'd rather not have Parse credentials in javascript.
I'm requiring the file with all of these endpoints after the
cloud/app.js looks like:
When calling up this endpoint via GET, in, say, a browser, I end up with two csrf errors in the server log:
These work fine on the live site hitting the hosted parse environment. Anyone else seen something like this? Is the
csurf
module interfering with theparse-server
module? Any suggestions I should try? Thanks!