Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access-Control-Allow-Origin Openstreetmap problem #179

Closed
michaelhjulskov opened this issue Feb 4, 2024 · 7 comments
Closed

Access-Control-Allow-Origin Openstreetmap problem #179

michaelhjulskov opened this issue Feb 4, 2024 · 7 comments

Comments

@michaelhjulskov
Copy link
Contributor

Hi

I get this error in my console

Access to XMLHttpRequest at 'https://nominatim.openstreetmap.org/search/?format=json&q=DK,%209310,%20vodskov' from origin 'https://unvaccinated.singles' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I did a little digging and it seems like a simple solution is

this url
https://nominatim.openstreetmap.org/search/?format=json&q=DK,%209310,%20vodskov

should be:
https://nominatim.openstreetmap.org/search?format=json&q=DK,%209310,%20vodskov

File not found: API no longer accessible via this URL
Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin
Change to: https://nominatim.openstreetmap.org/search?q=Berlin

You use: https://nominatim.openstreetmap.org/search/US/Texas/Huston
Change to: https://nominatim.openstreetmap.org/search?q=Huston, Texas, US

See github issue #3134 for more details.

@michaelhjulskov
Copy link
Contributor Author

but it appears here like it was already fixed

var url = '//nominatim.openstreetmap.org/search?format=json&q=' + address;

@caioariede
Copy link
Owner

Yeah, are you using the latest version?

@michaelhjulskov
Copy link
Contributor Author

yes
I found out that it was caused by an old cached version of the included js file
Dont know how I will fix it so its forced loaded

@caioariede
Copy link
Owner

@michaelhjulskov okay, so I think we can close this?

@michaelhjulskov
Copy link
Contributor Author

yes I can close it

But please let me know if you have an idea how to force read the new js fil

@michaelhjulskov
Copy link
Contributor Author

crap. I cant get it to work, because the browser keeps loading the old cached js file

@michaelhjulskov
Copy link
Contributor Author

HI Can I suggest to rename the included JS file if its altered. That would force browser to reload of the included JS file. My customers complain and f5 dont help.
Normally I add a file version in the filename or the script link - that normally solves this issue

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants