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

geocode.arcgis.com Bad HTTP Request #82

Closed
TheAwesomeGcdm opened this issue Oct 29, 2022 · 3 comments
Closed

geocode.arcgis.com Bad HTTP Request #82

TheAwesomeGcdm opened this issue Oct 29, 2022 · 3 comments

Comments

@TheAwesomeGcdm
Copy link

TheAwesomeGcdm commented Oct 29, 2022

When trying to choose a location when hosting on a local server, I get a bad HTTP request, even though I can access the host on another tab.

Browser: Firefox
OS: Windows 11

imagen

@vbguyny
Copy link
Owner

vbguyny commented Oct 29, 2022

Looks like a Cross-Origin Resource Sharing (CORS) issue. This is a setting which is defined by the host and enforced by the browser. There really isn't much you can do to work around this and it is a security feature of the web.
That being said you could try adding a hosts record that redirects you back to localhost. You might also need to generate a self-signed SSL certificate and assign it the domain related to your local web server.
The best option would be to have your site hosted somewhere and it should work.

@TheAwesomeGcdm
Copy link
Author

Okay, I followed your advice and created a SSL certificate for the local host by running the following command in PowerShell.
New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My"

Once I did that, I went to Microsoft Management Console (run mmc.exe in the run window) and went to File -> Add or Remove Snap-ins -> Certificates -> Add -> Computer account -> Local computer

Under the Personal folder, I copied the localhost certificate there and pasted it in the Trusted Root Certification Authorities, closing the window and saving the changes.

In IIS, I went to the page where WeatherStar is and went to Bindings -> Edit -> and changed http to https and set the SSL certificate to localhost.

Then I went to https://localhost:XXX/ws4kp and it works perfect!

@vbguyny
Copy link
Owner

vbguyny commented Oct 30, 2022

@TheAwesomeGcdm great job!!! Thank you for posting detailed steps on what you did to solve your issue. 🧑‍💻😎

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