Skip to content

Commit

Permalink
style: fix word spelling ang lint style in comment (#4500)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
MageeLin and jasonsaayman committed May 3, 2022
1 parent 3479ca7 commit ba85e0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions lib/adapters/http.js
Expand Up @@ -276,7 +276,7 @@ module.exports = function httpAdapter(config) {
case 'gzip':
case 'compress':
case 'deflate':
// add the unzipper to the body stream processing pipeline
// add the unzipper to the body stream processing pipeline
stream = stream.pipe(zlib.createUnzip());

// remove the content-encoding in order to not confuse downstream operations
Expand Down Expand Up @@ -305,7 +305,7 @@ module.exports = function httpAdapter(config) {

// make sure the content length is not over the maxContentLength if specified
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
// stream.destoy() emit aborted event before calling reject() on Node.js v16
// stream.destroy() emit aborted event before calling reject() on Node.js v16
rejected = true;
stream.destroy();
reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
Expand Down Expand Up @@ -381,7 +381,7 @@ module.exports = function httpAdapter(config) {
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
// And then these socket which be hang up will devoring CPU little by little.
// And then these socket which be hang up will devouring CPU little by little.
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
req.setTimeout(timeout, function handleRequestTimeout() {
req.abort();
Expand Down
24 changes: 12 additions & 12 deletions lib/helpers/isURLSameOrigin.js
Expand Up @@ -13,16 +13,16 @@ module.exports = (
var originURL;

/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;

if (msie) {
// IE needs attribute set twice to normalize properties
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
Expand All @@ -47,19 +47,19 @@ module.exports = (
originURL = resolveURL(window.location.href);

/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :

// Non standard browser envs (web workers, react-native) lack needed support.
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
Expand Down

0 comments on commit ba85e0e

Please sign in to comment.