Git Product home page Git Product logo

Comments (5)

gorhill avatar gorhill commented on June 30, 2024

Strange. I can not repro, and code reviewing I can't see where this could happen. The only thing I can think of is that 503 is not considered as an error when using a XHR, and thus the error path was not taken by uMatrix, and thus it ended up loading a 503 web page as a hosts file.

from umatrix.

gorhill avatar gorhill commented on June 30, 2024

Fixed with b946a96.

I need to also import the fix in uBlock, this might actually explain why some users report uBlock stopped blocking ads: if EasyList could not be downloaded the same way it happened above to hpHosts, that would cause uBlock to not see the failed request and interpret the error page as a valid EasyList file.

from umatrix.

harshanvn avatar harshanvn commented on June 30, 2024

I may be completely wrong here. Just throwing my 2 cents here...

if ( typeof this.status === 'number' && this.status >= 200 && this.status < 300 ) {

In the above line of code, i don't see why we need a first condition here. As http status code will always be of type number. Below condition itself may be enough..Sorry if am wrong here..

if ( this.status >= 200 && this.status < 300 ) {

Please see the link below for list of status codes-
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

from umatrix.

gorhill avatar gorhill commented on June 30, 2024

It's just to be on the safe side in case it is undefined, in which case typeof this.status would return 'undefined'.

Of course I went to look at 503 code spec before the fix...

from umatrix.

harshanvn avatar harshanvn commented on June 30, 2024

hmm...ok. I am just thinking whether this situation can occur ever, as property type of status should never change. Anywayz, better safe than sorry :)

from umatrix.

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.