-
Notifications
You must be signed in to change notification settings - Fork 14
Should OPTIONS requests do any validation? #160
Comments
I did some testing with the GitHub API and found that they do not do validation and/or lookups on OPTIONS requests:
|
It's probably because OPTIONS requests are mainly generated by browsers, and don't modify anything. it'd just be unnecessary overhead for the server to validate |
It does sound like we can/should modify the options requests to return 204 statuses instead of 200 |
@cadecairos I agree that changing the status code to a 204 makes sense but I think the reason we shouldn't do validation on the server in the OPTIONS request is that the browser doesn't send the results of the CORS preflight request to the XHR. It just sets the error status on the XHR and prevents it from working. |
That's a good point. The UA will inevitably try hitting the same route with GET/POST/PATCH etc and get the right status anyways. |
@ashleygwilliams was working on implementing shallow routes for
/users/{userid}
when she brought up the fact that we're not doing any validation of theuserid
parameter:api.webmaker.org/services/api/routes/authenticated.js
Lines 116 to 131 in d012234
The text was updated successfully, but these errors were encountered: