Coder Social home page Coder Social logo

CORS errors about configmanager HOT 6 CLOSED

nrwiersma avatar nrwiersma commented on July 22, 2024
CORS errors

from configmanager.

Comments (6)

nrwiersma avatar nrwiersma commented on July 22, 2024

You would need to add server.sendHeader("Access-Control-Allow-Origin", "*"); to all handle* functions in the lib. A pull request to this effect would be welcome.

from configmanager.

Frtrillo avatar Frtrillo commented on July 22, 2024

You would need to add server.sendHeader("Access-Control-Allow-Origin", "*"); to all handle* functions in the lib. A pull request to this effect would be welcome.

Im willing to do it but it still isn't working. I've added it like this:
image
And now im getting a different error:

image

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

Chrome does not support CORS on localhost. That is the reason for the other issue.

from configmanager.

Frtrillo avatar Frtrillo commented on July 22, 2024

Chrome does not support CORS on localhost. That is the reason for the other issue.

Angular app will do the request from localhost though, which is one of the mainly (and good) uses for the library I think. Somehow throught browser is working /scan by removing some tokens my app added in the request:
image
And im getting the networks json. But it isn't working on the phone indeed.

Also what I still can't make it to work is to POST:
image
image

image

Maybe adding something like send status 200 would work?

Or I think on the POST one maybe this should work: server->sendHeader(F("Access-Control-Allow-Methods"),
F("PUT,POST,GET,OPTIONS")); but it isn't working either so I think the sendHeader isn't working

from configmanager.

nrwiersma avatar nrwiersma commented on July 22, 2024

The issue is that your server is on localhost, and chrome has blocked CORS on localhost: https://stackoverflow.com/questions/10883211/why-does-my-http-localhost-cors-origin-not-work

from configmanager.

Frtrillo avatar Frtrillo commented on July 22, 2024

The issue is that your server is on localhost, and chrome has blocked CORS on localhost: https://stackoverflow.com/questions/10883211/why-does-my-http-localhost-cors-origin-not-work

I've fixed it to work on the localhost browser too, Ill do a pull request later

image

from configmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.