How to use the uri-js.normalize function in uri-js

To help you get started, we’ve selected a few uri-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adobe / helix-cli / src / openwhisk / static.js View on Github external
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();
}
github gabceb / node-metainspector / index.js View on Github external
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;

uri-js

An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.

BSD-2-Clause
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis