mdasberg / ng-apimock

Node plugin that provides the ability to use scenario based api mocking: for local development for protractor testing
MIT License
99 stars 26 forks source link

Passthrough doesn't forward request headers? #31

Closed sandervalstar closed 6 years ago

sandervalstar commented 6 years ago

I'm working on a project that integrates with AWS. If I take ng-apimock out of the chain I can do requests to AWS without issues, but when I set my ng-apimocks to Passthrough I get the following error from AWS: "message": "Missing Authentication Token"

This token is supposed to be set in the "x-api-key" header. When I look at my request in the network tab of chrome inspector, I see the header is present on the failed request.

So it seems that ng-apimock doesn't forward the headers when proxying a request. Is that correct or am I missing something else here?

sandervalstar commented 6 years ago

Never mind, I did some more investigation and found the Passthrough url I had configured missed a "/api" at the end. Apparently AWS likes to give a 403 with an authentication error message instead of a 404 if your url is wrong...