question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS stopped working

See original GitHub issue

CORS headers for Hoodie APIs no longer get set, so cross origin requests fail.

Steps to reproduce:

  1. git clone https://github.com/hoodiehq/hoodie-app-tracker.git
  2. cd hoodie-app-tracker/
  3. npm start -- --url="http://localhost:8080"
  4. Open http://127.0.0.1:8080/account.html in an incognito / private tab.
  5. Try to log in.

A message like this should appear in the console:

XMLHttpRequest cannot load http://localhost:8080/hoodie/account/api/session. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://127.0.0.1:8080’ is therefore not allowed access. The response had HTTP status code 404.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sdvgcommented, Aug 25, 2016

@gr2m Not really, I spent some time on this but didn’t find out much new. The Hoodie implementation looks got to me (but I didn’t find much documentation on the sandbox feature).

Next steps could be to look for a solution in the hapi code or to build a reduced test case. I can’t tell when I’ll find the time to do so 😕

1reaction
gr2mcommented, Aug 24, 2016

Hey @sdvg any update on the issue? @brunopedroso just run into the same thing

For the record: a temporary workaround is to remove sandbox: 'plugin' from https://github.com/hoodiehq/hoodie/blob/master/server/index.js#L55

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin ...
Read more >
CORS errors and how to solve them - Topcoder
Open a network tab in your console. ... In the response header look for the Access-Control-Allow-Origin header. If it does not exist then...
Read more >
CORS not working anymore - Stack Overflow
When I go to the website I get "Failed to load dashboard.inofec.nl/ip: The 'Access-Control-Allow-Origin' header contains multiple values 'inofec ...
Read more >
3 Ways to Fix the CORS Error — and How the Access-Control ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >
A Guide to Solving Those Mystifying CORS Issues
CORS stands for Cross-Origin Resource Sharing. ... a lot of misconceptions about CORS and plenty of available 'solutions' that don't work.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found