At Eventbrite we're building a Node render server to connect with our Django backend. We need to pass the language from Django to Node. The API of the server expects the language to be passed in the request headers as Accept-Language.
python-react passes the request header for the Content-type, but doesn't provide a facility to add additional request headers. This PR does that. While it is a change to the API, it should be backwards compatible since it's an additional defaulted parameter (request_headers). However, I imagine that anyone who has created their own renderer would have to update the API so that it accepts this 4th parameter.
I added a test as well as updated the relevant documentation. We are currently pointing to my fork, but would love for this change to be folded back in and published to NPM.
At Eventbrite we're building a Node render server to connect with our Django backend. We need to pass the language from Django to Node. The API of the server expects the language to be passed in the request headers as
Accept-Language
.python-react
passes the request header for theContent-type
, but doesn't provide a facility to add additional request headers. This PR does that. While it is a change to the API, it should be backwards compatible since it's an additional defaulted parameter (request_headers
). However, I imagine that anyone who has created their ownrenderer
would have to update the API so that it accepts this 4th parameter.I added a test as well as updated the relevant documentation. We are currently pointing to my fork, but would love for this change to be folded back in and published to NPM.
Let me know if you need any updates!