Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

[v6.0.3] Access-Control-Allow-Origin: "null", can't switch to "*" #28

Open
thomsh opened this issue Jun 3, 2020 · 0 comments
Open

[v6.0.3] Access-Control-Allow-Origin: "null", can't switch to "*" #28

thomsh opened this issue Jun 3, 2020 · 0 comments

Comments

@thomsh
Copy link

thomsh commented Jun 3, 2020

Hi,
Starting using tzindex, looklike to be a great explorer api for tezos, however I found that the CORS policy is not set as intended:

Not working as excepted:

  1. Excepted to be set to Access-Control-Allow-Origin: * when using arg --enable-cors
  2. Excepted to be set to Access-Control-Allow-Origin: * when using docker env variable 'TZ_SERVER_CORS_ORIGIN=*' to set it to Access-Control-Allow-Origin: *
    I got it set to Access-Control-Allow-Origin: for both case

Working as excepted:
However the docker env var with something else that * like TZ_SERVER_CORS_ORIGIN=http://example.com works !

i'm using the docker image on docker hub tag:v6.0.3
Example to reproduce, http://172.17.0.1:8732 is a valid tezos node,

docker run -it --rm \
  -v /data/tzindex:/data:rw -p 0.0.0.0:8000:8000 \
   -e 'TZ_SERVER_CORS_ORIGIN=*' \
  blockwatch/tzindex:v6.0.3 \
  tzindex run --enable-cors --dbpath /data --rpcurl http://172.17.0.1:8732

Then have a look to the http header:
curl -v http://localhost:8000 serach Access-Control-Allow-Origin header

@thomsh thomsh changed the title Access-Control-Allow-Origin: "null" by default not "*", Env var not working v6.0.3 [v6.0.3] Access-Control-Allow-Origin: "null" by default not "*", can't switch to "*" Jun 3, 2020
@thomsh thomsh changed the title [v6.0.3] Access-Control-Allow-Origin: "null" by default not "*", can't switch to "*" [v6.0.3] Access-Control-Allow-Origin: "null", can't switch to "*" Jun 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant