aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-08-01 14:17:23 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-08-10 08:48:24 +0200
commitf90446e631b244856e5f495d89491ee2356ecbef (patch)
tree9ae2b1185a44ada3df9f28461a2f628c5955eea7
parentcbcd6f9001d5b18957b7f5a3fb88865c863d9464 (diff)
downloadfengari-f90446e631b244856e5f495d89491ee2356ecbef.tar.gz
fengari-f90446e631b244856e5f495d89491ee2356ecbef.tar.bz2
fengari-f90446e631b244856e5f495d89491ee2356ecbef.zip
Do GET instead of HEAD so the following GET is cached
-rw-r--r--src/loadlib.js6
1 files 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? */