Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some word spelling and Lint style in comment #4500

Merged
merged 2 commits into from May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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