-
Notifications
You must be signed in to change notification settings - Fork 471
Need to restore old version of asset if updating them is failed.. #15
Comments
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. |
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. |
I may be completely wrong here. Just throwing my 2 cents here...
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..
Please see the link below for list of status codes- |
It's just to be on the safe side in case it is undefined, in which case Of course I went to look at 503 code spec before the fix... |
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 :) |
Did a forced update on host files.
After update saw blocked host name count reduced from 62k to 44k. Upon closed inspection saw, below error in the console..
Failed to load resource: the server responded with a status of 503 (Service Unavailable) http://hosts-file.net/.%5Cad_servers.txt
And looking at the host file count..saw below..
The text was updated successfully, but these errors were encountered: