CORS error even with `CORS_ALLOW=*`

Open
#505 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker
Domain
api, backend

Research direction

Start with the provided Docker command and the failing preflight request to /regtest/api/address/bcrt1pw4egam6splawuqt6djwex5x7kxenwezwcu60plt28fenmqe8zn3q9t0evs/utxo. Check how the CORS_ALLOW=* environment variable is handled and why the preflight returns 404; done means explaining the behavior and identifying the required configuration or endpoint change.

Written by the indexing model from the issue text.

Description

I am running Esplora via docker run --name esplora-container -p 50001:50001 -p 8094:80 --volume $PWD/data_bitcoin_regtest:/data -e CORS_ALLOW=* --rm -i -t blockstream/esplora bash -c "/srv/explorer/run.sh bitcoin-regtest explorer" command but I am getting the error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8094/regtest/api/address/bcrt1pw4egam6splawuqt6djwex5x7kxenwezwcu60plt28fenmqe8zn3q9t0evs/utxo. (Reason: CORS preflight response did not succeed). Status code: 404.

Why is this happening since I am passing the CORS_ALLOW=* env var ?

Dominant language
JavaScript
Stars
1.3k
Forks
527
Avg merge
2d 5h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Blockstream/esplora

All issues in Blockstream/esplora

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.