[SOLVED] Headers being stripped

Hi all, I’m new to ember and fairly new to javascript applications, so I might just be doing something incredibly wrong here and would appreciate your help.

Here’s my scenario: I have a backend that will serve multiple frontends served from different domains. I have CORS setup and the necessary headers, including Access-Control-Expose-Headers et all.

During development, I am using ember-cli-mirage and ember-simple-auth with a custom authenticator to handle all the headers I need, and things were working correctly.

As the backend got ready, I used ember-cli-mirage’s passthrough to talk with the server, also with no issues.

As I got all endpoints ready on the server, I disabled ember-cli-mirage and authentication stopped working. I’ve traced it to the headers being dropped - they don’t get passed on the response for the auth fetch - but they did before, with mirage’s passthrough - so I’m assuming the library still does some work to allow the headers to correctly pass down. Any idea of what’s happening and how to fix it?

For posterity, in case someone runs into this - I fixed it. I had not imported the fetchmodule. Importing fetch fixed the issue with the headers. :man_facepalming:

1 Like