Minify: Don't ignore request headers in `requestURI()`
parent
7a003cb9e2
commit
7efca7dc7d
|
@ -48,10 +48,7 @@ const LIBRARY_WHITELIST = [
|
||||||
|
|
||||||
// What follows is a terrible hack to avoid loop-back within the server.
|
// What follows is a terrible hack to avoid loop-back within the server.
|
||||||
// TODO: Serve files from another service, or directly from the file system.
|
// TODO: Serve files from another service, or directly from the file system.
|
||||||
const requestURI = async (url, method, headers) => {
|
const requestURI = async (url, method, headers) => await new Promise((resolve, reject) => {
|
||||||
var headers = {};
|
|
||||||
|
|
||||||
return await new Promise((resolve, reject) => {
|
|
||||||
const parsedURL = urlutil.parse(url);
|
const parsedURL = urlutil.parse(url);
|
||||||
let status = 500;
|
let status = 500;
|
||||||
const content = [];
|
const content = [];
|
||||||
|
@ -86,7 +83,6 @@ const requestURI = async (url, method, headers) => {
|
||||||
};
|
};
|
||||||
minify(mockRequest, mockResponse).catch(reject);
|
minify(mockRequest, mockResponse).catch(reject);
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
const requestURIs = (locations, method, headers, callback) => {
|
const requestURIs = (locations, method, headers, callback) => {
|
||||||
Promise.all(locations.map((loc) => requestURI(loc, method, headers))).then((responses) => {
|
Promise.all(locations.map((loc) => requestURI(loc, method, headers))).then((responses) => {
|
||||||
|
|
Loading…
Reference in New Issue