From f90446e631b244856e5f495d89491ee2356ecbef Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 1 Aug 2017 14:17:23 +0200 Subject: Do GET instead of HEAD so the following GET is cached --- src/loadlib.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/loadlib.js b/src/loadlib.js index 7562cea..e448381 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -75,7 +75,7 @@ const noenv = function(L) { return b; }; -let readable = function(filename) { +let readable = function() { return false; }; // Only with Node @@ -98,9 +98,9 @@ if (!WEB) { } else { /* TODO: use async/await ? */ readable = function(filename) { - /* TODO: do a GET and store it somewhere to avoid doing two roundtrips ? */ let xhr = new XMLHttpRequest(); - xhr.open("HEAD", lua.to_jsstring(filename), false); + /* Following GET request done by searcher_Web will be cached */ + xhr.open("GET", lua.to_jsstring(filename), false); xhr.send(); /* TODO: subresource integrity check? */ -- cgit v1.2.3-70-g09d2