Giter Club home page Giter Club logo

Comments (16)

DrDelete avatar DrDelete commented on June 30, 2024

Same bug encountered on Win8 with IE10/CORS.

from angular-http-auth.

Traxmaxx avatar Traxmaxx commented on June 30, 2024

Thanks for the info.
Any plans for fixing this on master or is this use-case too rare? The solution above is still working but it could be prettier though.

from angular-http-auth.

stereokai avatar stereokai commented on June 30, 2024

@witoldsz, as the maintainer of this module, what is your view on this issue? Thank you.

from angular-http-auth.

witoldsz avatar witoldsz commented on June 30, 2024

I think that fixing or walking over the bugs of the thing called IE is out of the scope of this project.
I am pretty sure someone can provide a fix for broken IE XHR requests for AngularJS (or maybe a lever below AngularJS), maybe as a $http interceptor, so once the response hits this one, the status code will be correct already.

from angular-http-auth.

stereokai avatar stereokai commented on June 30, 2024

Are $http interceptors different than $httpProvider interceptors?

from angular-http-auth.

witoldsz avatar witoldsz commented on June 30, 2024

@stereokai $http is a service created (provided) by $httpProvider. We register "HTTP interceptors" when configuring the $httpProvider, so $http service has them once it is created.

from angular-http-auth.

stereokai avatar stereokai commented on June 30, 2024

How can you make sure the interceptor responsible for taking care of the IE bug takes place before any other interceptor? Declare (push) it first?

from angular-http-auth.

witoldsz avatar witoldsz commented on June 30, 2024

Well, looking at the API, I guess you have to push it at the beginning of the queue and make sure there are no other modules pushing anything before it. I can't recall any other priority mechanism for http interceptors.

from angular-http-auth.

stereokai avatar stereokai commented on June 30, 2024

Sweet, thank you.

from angular-http-auth.

scott-cornwell avatar scott-cornwell commented on June 30, 2024

Looks like this has been changed in 1.3, I was having problems because Angular was turning status of 0 into a 404 before the interceptors fired. Thanks!

from angular-http-auth.

kelu95 avatar kelu95 commented on June 30, 2024

Well, with chrome and latest angular (1.3.0-beta.17), angular always return status 0 on OPTIONS request error. Is it possible to fix that ? Thanks

from angular-http-auth.

witoldsz avatar witoldsz commented on June 30, 2024

What am I supposed to do? Fix Angular, Chrome, both?

from angular-http-auth.

kelu95 avatar kelu95 commented on June 30, 2024

maybe you can try :)
But is it possible to test response.status === 0 as on 1st comment ?

from angular-http-auth.

witoldsz avatar witoldsz commented on June 30, 2024

No, that is not possible, I am sorry. But you can do it in your own $http interceptor and insert it at the beginning, so this module will see whatever you tweak over there.

from angular-http-auth.

stereokai avatar stereokai commented on June 30, 2024

What am I supposed to do? Fix Angular, Chrome, both?

@witoldsz If there was a bash.org for Github Comments, this comment would be ranked #1.

from angular-http-auth.

bobbly13 avatar bobbly13 commented on June 30, 2024

Not sure if people found a resolution to this, but I found that status 0 was only returned if the Pre-Flight OPTIONS request returned a non 200 code.

It seems that the Angular $resource module has logic to translate these status codes to a 0.

If I make OPTIONS requests non authorised on the server side then when the subsequent request (GET,POST, etc) is made then the status is correctly returned as 401 formunathorised

Express example:

app.use(jwt({ secret: secret}).unless({ method: 'OPTIONS', path: ['/token']}));

from angular-http-auth.

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.