rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 313 forks source link

allow x-http-method-override header to be passed in from the client request #478

Closed ingiulio closed 9 years ago

ingiulio commented 9 years ago

This would allow more flexibility into apiProxy, allowing the usage of the x-http-method-override header. Currently, if we try to to use Backbone's emulateHTTP option ( http://backbonejs.org/#Sync-emulateHTTP), the header set from the client is then discarded by the Rendr app.

purusho commented 9 years ago

:+1:

bigethan commented 9 years ago

The dataAdapter also deal with the headers, should this go there? I do agree that this header should be respected, not sure if this is the right place. eg, should getXForwardedForHeader also be moved into the data adapter? OR is there something I'm missing why this needs to happen here?

bigethan commented 9 years ago

ah I totally missed https://github.com/ingiulio/rendr/blob/allowXHTTPMethodOverrideHeader/server/middleware/apiProxy.js#L24 where that is defined, I thought it'd just take everything in, not start fresh. Apologies and :+1: for this, and perhaps thinking about a way that all future headers would be respected, not just whitelisted.