GithubHelp home page GithubHelp logo

Comments (3)

nucleartide avatar nucleartide commented on May 3, 2024

Hey, @resistdesign! I had the same problem, but from reading the tests it seems like you have to send an Origin header in your request. Here's an example with curl, it'll hit an endpoint that returns "hello world":

$ curl -H "Origin: *" --verbose http://localhost:4000/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4000 (#0)
> GET /helloworld HTTP/1.1
> User-Agent: curl/7.37.1
> Host: localhost:4000
> Accept: */*
> Origin: *
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Content-Type: text/plain; charset=utf-8
< Content-Length: 11
< Date: Tue, 12 Jan 2016 16:04:14 GMT
< Connection: keep-alive
<
* Connection #0 to host localhost left intact
hello world

from cors.

dougwilson avatar dougwilson commented on May 3, 2024

@nucleartide is correct. Just having CORS enabled does not just blindly send back response headers; the request itself needs to be a CORS request to the server (either a simple request or a pre-flight request). You can read more details about how CORS works at http://www.w3.org/TR/cors/

@resistdesign , can you show the full request and headers you are making, and what the response headers you are getting a highlight to us what is not meeting your expectation?

from cors.

resistdesign avatar resistdesign commented on May 3, 2024

@nucleartide Thank you!

@dougwilson I don't even remember what I was doing now, sorry :P

from cors.

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.