Giter Site home page Giter Site logo

Support CORS about freegeoip HOT 1 CLOSED

sandeep45 avatar sandeep45 commented on August 18, 2024
Support CORS

from freegeoip.

Comments (1)

fiorix avatar fiorix commented on August 18, 2024

On Mar 19, 2014, at 4:27 PM, Sandeep Arneja [email protected] wrote:

Are there any plans on supporting CORS requests?

It's already there for OPTION requests:

~ $ curl -vX OPTIONS freegeoip.net/json/
> OPTIONS /json/ HTTP/1.1
> User-Agent: curl/7.30.0
> Host: freegeoip.net
> Accept: */*
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: X-Requested-With
< Access-Control-Allow-Methods: GET
< Access-Control-Allow-Origin: *
< Content-Type: text/plain
< Date: Wed, 19 Mar 2014 20:31:41 GMT
< Content-Length: 0

JSONP works mostly but it doesn't expose the error event. Occasionally I have some IP's which result in a 404 error response. With JSONP I can't get the error response and therefore don't know why it failed. If i could catch the error then I would mark it as failed and then not look it up the next time.

You should be able to handle 404 normally, see the link below for details:

http://stackoverflow.com/questions/2493974/how-to-callback-a-function-on-404-in-json-ajax-request-with-jquery


Reply to this email directly or view it on GitHub.

from freegeoip.

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.