Skip to content

Commit 7d84b54

Browse files
committed
Only allow XHR status 0 for local file:// URLs
Since 0 can also be an error situation, limit the amount we okay it.
1 parent 44f9b10 commit 7d84b54

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/loader/File.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ var File = new Class({
315315
*/
316316
onLoad: function (xhr, event)
317317
{
318-
var success = !(event.target && (event.target.status !== 200 && event.target.status !== 0));
318+
var localFileOk = xhr.responseURL.indexOf('file://') == 0 &&
319+
event.target.status === 0;
320+
321+
var success = !(event.target && event.target.status !== 200) || localFileOk;
319322

320323
// Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.
321324
if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)

0 commit comments

Comments
 (0)