t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
545 stars 68 forks source link

CORS error "origin validation failed" with 0.14 #257

Closed vladimir-rybalko closed 2 years ago

vladimir-rybalko commented 2 years ago

HI! I have deployed t-rex version 0.14 in Docker in server host. And trying get VectorTiles to my local app(OpenLayers). In my clien app i have CORS error. In log on Docker container i have error DEBUG origin validation failed; inner service is not called For running service i use command on Docker container t_rex serve --dbconn postgresql://t_rex:t_rex@db:5432/t_rex --openbrowser false --port 80 --bind 0.0.0.0 --loglevel debug What is my problem?

UPDATE: When I downgraded to 0.13 the problem was solved.

pka commented 2 years ago

actix-cors has been updated from 0.3 to 0.5 and it looks like default settings have changed: https://github.com/actix/actix-extras/blob/master/actix-cors/CHANGES.md#050---2020-10-19

tobwen commented 2 years ago

Yeah, I can verify this. I also have to downgrade to v0.13 :(

tobwen commented 2 years ago
.wrap(Cors::default().allow_any_origin().send_wildcard().allowed_methods(vec!["GET"]))

Makes the situation a bit better, but Leaflet in Chrome still has issues.

Offtopic: I'm neither into Rust, nor into actix, but I'm really shocked, how bad it's documented and that every release breaks important stuff.