Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

Location:
trip-planner-front/node_modules/follow-redirects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/follow-redirects/index.js

    r59329aa re29cc2e  
    1919var RedirectionError = createErrorType(
    2020  "ERR_FR_REDIRECTION_FAILURE",
    21   ""
     21  "Redirected request failed"
    2222);
    2323var TooManyRedirectsError = createErrorType(
     
    170170  // Stops a timeout from triggering
    171171  function clearTimer() {
     172    // Clear the timeout
    172173    if (self._timeout) {
    173174      clearTimeout(self._timeout);
    174175      self._timeout = null;
    175176    }
     177
     178    // Clean up all attached listeners
     179    self.removeListener("abort", clearTimer);
     180    self.removeListener("error", clearTimer);
     181    self.removeListener("response", clearTimer);
    176182    if (callback) {
    177183      self.removeListener("timeout", callback);
     
    197203  // Clean up on events
    198204  this.on("socket", destroyOnTimeout);
    199   this.once("response", clearTimer);
    200   this.once("error", clearTimer);
     205  this.on("abort", clearTimer);
     206  this.on("error", clearTimer);
     207  this.on("response", clearTimer);
    201208
    202209  return this;
     
    362369
    363370    // Drop the Host header, as the redirect might lead to a different host
    364     var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||
    365       url.parse(this._currentUrl).hostname;
     371    var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
     372
     373    // If the redirect is relative, carry over the host of the last request
     374    var currentUrlParts = url.parse(this._currentUrl);
     375    var currentHost = currentHostHeader || currentUrlParts.host;
     376    var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
     377      url.format(Object.assign(currentUrlParts, { host: currentHost }));
     378
     379    // Determine the URL of the redirection
     380    var redirectUrl;
     381    try {
     382      redirectUrl = url.resolve(currentUrl, location);
     383    }
     384    catch (cause) {
     385      this.emit("error", new RedirectionError(cause));
     386      return;
     387    }
    366388
    367389    // Create the redirected request
    368     var redirectUrl = url.resolve(this._currentUrl, location);
    369390    debug("redirecting to", redirectUrl);
    370391    this._isRedirect = true;
     
    372393    Object.assign(this._options, redirectUrlParts);
    373394
    374     // Drop the Authorization header if redirecting to another host
    375     if (redirectUrlParts.hostname !== previousHostName) {
     395    // Drop the Authorization header if redirecting to another domain
     396    if (!(redirectUrlParts.host === currentHost || isSubdomainOf(redirectUrlParts.host, currentHost))) {
    376397      removeMatchingHeaders(/^authorization$/i, this._options.headers);
    377398    }
     
    395416    }
    396417    catch (cause) {
    397       var error = new RedirectionError("Redirected request failed: " + cause.message);
    398       error.cause = cause;
    399       this.emit("error", error);
     418      this.emit("error", new RedirectionError(cause));
    400419    }
    401420  }
     
    507526  for (var header in headers) {
    508527    if (regex.test(header)) {
    509       lastValue = headers[header];
     528      lastValue = headers[header].toString().trim();
    510529      delete headers[header];
    511530    }
     
    515534
    516535function createErrorType(code, defaultMessage) {
    517   function CustomError(message) {
     536  function CustomError(cause) {
    518537    Error.captureStackTrace(this, this.constructor);
    519     this.message = message || defaultMessage;
     538    if (!cause) {
     539      this.message = defaultMessage;
     540    }
     541    else {
     542      this.message = defaultMessage + ": " + cause.message;
     543      this.cause = cause;
     544    }
    520545  }
    521546  CustomError.prototype = new Error();
     
    534559}
    535560
     561function isSubdomainOf(subdomain, domain) {
     562  const dot = subdomain.length - domain.length - 1;
     563  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
     564}
     565
    536566// Exports
    537567module.exports = wrap({ http: http, https: https });
  • trip-planner-front/node_modules/follow-redirects/package.json

    r59329aa re29cc2e  
    11{
    2   "_args": [
    3     [
    4       "follow-redirects@1.14.4",
    5       "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front"
    6     ]
    7   ],
    8   "_development": true,
    9   "_from": "follow-redirects@1.14.4",
    10   "_id": "follow-redirects@1.14.4",
     2  "_from": "follow-redirects@^1.0.0",
     3  "_id": "follow-redirects@1.14.5",
    114  "_inBundle": false,
    12   "_integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
     5  "_integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
    136  "_location": "/follow-redirects",
    147  "_phantomChildren": {},
    158  "_requested": {
    16     "type": "version",
     9    "type": "range",
    1710    "registry": true,
    18     "raw": "follow-redirects@1.14.4",
     11    "raw": "follow-redirects@^1.0.0",
    1912    "name": "follow-redirects",
    2013    "escapedName": "follow-redirects",
    21     "rawSpec": "1.14.4",
     14    "rawSpec": "^1.0.0",
    2215    "saveSpec": null,
    23     "fetchSpec": "1.14.4"
     16    "fetchSpec": "^1.0.0"
    2417  },
    2518  "_requiredBy": [
    2619    "/http-proxy"
    2720  ],
    28   "_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
    29   "_spec": "1.14.4",
    30   "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front",
     21  "_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
     22  "_shasum": "f09a5848981d3c772b5392309778523f8d85c381",
     23  "_spec": "follow-redirects@^1.0.0",
     24  "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\node_modules\\http-proxy",
    3125  "author": {
    3226    "name": "Ruben Verborgh",
     
    3731    "url": "https://github.com/follow-redirects/follow-redirects/issues"
    3832  },
     33  "bundleDependencies": false,
    3934  "contributors": [
    4035    {
     
    4843    }
    4944  ],
     45  "deprecated": false,
    5046  "description": "HTTP and HTTPS modules that follow redirects.",
    5147  "devDependencies": {
     
    9692    "test": "npm run lint && npm run mocha"
    9793  },
    98   "version": "1.14.4"
     94  "version": "1.14.5"
    9995}
Note: See TracChangeset for help on using the changeset viewer.