Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main({
owner,
repo,
ref = 'master',
path,
entry,
strain = 'default',
plain = false,
allow,
deny,
root = '',
esi = false,
}) {
console.log('main()', owner, repo, ref, path, entry, strain, plain, allow, deny, root);
const file = uri.normalize(entry);
console.log(file);
if (blacklisted(file, allow, deny)) {
return forbidden();
}
if (plain) {
return deliverPlain(owner, repo, ref, file, root, esi);
}
return forbidden();
}
var MetaInspector = function(url, options) {
this.url = URI.normalize(withDefaultScheme(url));
this.parsedUrl = URI.parse(this.url);
this.scheme = this.parsedUrl.scheme;
this.host = this.parsedUrl.host;
this.rootUrl = this.scheme + "://" + this.host;
this.options = options || {};
//default to a sane limit, since for meta-inspector usually 5 redirects should do a job
//more over beyond this there could be an issue with event emitter loop detection with new nodejs version
//which prevents error event from getting fired
this.options.maxRedirects = this.options.maxRedirects || 5;
//some urls are timing out after one minute, hence need to specify a reasonable default timeout
this.options.timeout = this.options.timeout || 20000; //Timeout in ms
this.options.strictSSL = !!this.options.strictSSL;