You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@paparomeo, I created a fork, implemented the check and added a test ( tests/custom-middleware.js): hpawe01@e6d3b77.
The single test succeeds (npm test -- --grep headers), but not together with the others (npm test). When I change the filename of the test to 0custom-middleware.js, the test is executed at first and it succeeds, but now the test options.js fails. It seems like all tests are using the same instance of the jsonApiTestServer, and that I cannot change the underlying express-server just for a single test. Do you have an idea how to achieve this?
Hello,
I use the possibility to modify the Express server before starting it as described in https://github.com/holidayextras/jsonapi-server/blob/master/documentation/configuring.md#gaining-access-to-the-express-server
For example, I need cookie-authentication and have to add some headers:
But the header
Access-Control-Allow-Origin
gets overwritten during the initialization of the json api server:jsonapi-server/lib/router.js
Lines 23 to 30 in 368ad6b
I changed it locally, so that the header is only set, when it is not already present:
Should I prepare a pull request with this change? Or does this break something I am not aware of?
Cheers,
Friedrich
The text was updated successfully, but these errors were encountered: