-
Notifications
You must be signed in to change notification settings - Fork 41
Remove axios dependency #374
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
base: master
Are you sure you want to change the base?
Conversation
"Accept-Encoding": "gzip,deflate", | ||
Connection: "Keep-Alive", | ||
}), | ||
keepalive: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do this elsewhere ? (keepalive:false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so before we had this code:
if (isNodeLike) {
// keepAlive pools and reuses TCP connections, so it's faster
axiosProps.httpAgent = new http.Agent({ keepAlive: true });
axiosProps.httpsAgent = new https.Agent({ keepAlive: true });
}
So it should be keepalive: true I guess.
I assume the reason we only did it in node before is because it wasn't supported in browser, so now we should always have it on?
} | ||
} | ||
const response = await fetch(this.getAuthMetadataEndpointFromClusterUri(kustoUri), { | ||
// TODO - is this still true for fetch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its easy to test - just use a not real cluster url
although btw i think this is not the behavior in c# - if cluster doesnt response we throw in C# ...
Or is the case here needs to be a real cluster that is just down (also easy to test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I see it's working, though I'm not 100% about if it's the same scenario.
I think we can remove this for now and see if someone complains?
timeout, | ||
body: payload, | ||
headers: { ...this._baseRequest.headers, ...headers }, | ||
duplex: isPayloadStream ? "half" : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeJS throws if it's not set. I'll add a comment.
Like Gil suggested.
It makes the code simpler, and doesn't seem to have problems for the browser