3

I am trying to nock an axios request. I have successfully mocked the POST request, but it is sending an OPTIONS preflight request. However, I am getting the following error and not sure what to make of it.

Error: Headers Authorization forbidden
timmyg13
  • 503
  • 1
  • 5
  • 15

1 Answers1

0

Are you using jsdom? You will most probably need to add the following reply header:

'access-control-allow-headers': 'Authorization'

See https://github.com/jsdom/jsdom/issues/2408.

dominik
  • 127
  • 2
  • 7