Skip to main content
1 of 3
Mark G
  • 3.1k
  • 14
  • 3

Missing referer header in Chrome when using code snippet

I created an answer for HERE maps autocomplete API on Stack Overflow and I'm having an issue with the HTTP_REFERER header not being sent when using Chrome browser (works fine w/ Edge and IE).

This causes an problem since the ajax call to the API returns 401 (unauthorized) in the code snippet. The API relies on the HTTP_REFERER header as a means to prevent misuse.

Looking at the problem I noticed that the generated iframe element doesn't have a src attribute and that it appears that this is a known issue in Chromium.

Is there anyway to overcome this? Maybe add a dummy src attribute set as https://stacksnippets.net/?

Mark G
  • 3.1k
  • 14
  • 3