mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-23 07:09:01 +01:00
feat: use timeout for axios requests
This commit is contained in:
parent
a2b6bc5970
commit
ad3f1b2331
@ -205,6 +205,8 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
});
|
||||
|
||||
const preferences = getPreferences();
|
||||
const timeout = get(preferences, 'request.timeout', 0);
|
||||
request.timeout = timeout;
|
||||
const sslVerification = get(preferences, 'request.sslVerification', true);
|
||||
const httpsAgentRequestFields = {};
|
||||
if (!sslVerification) {
|
||||
@ -505,6 +507,8 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
const preparedRequest = prepareGqlIntrospectionRequest(endpoint, envVars, request, collectionRoot);
|
||||
|
||||
const preferences = getPreferences();
|
||||
const timeout = get(preferences, 'request.timeout', 0);
|
||||
request.timeout = timeout;
|
||||
const sslVerification = get(preferences, 'request.sslVerification', true);
|
||||
|
||||
if (!sslVerification) {
|
||||
@ -683,6 +687,8 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
});
|
||||
|
||||
const preferences = getPreferences();
|
||||
const timeout = get(preferences, 'request.timeout', 0);
|
||||
request.timeout = timeout;
|
||||
const sslVerification = get(preferences, 'request.sslVerification', true);
|
||||
|
||||
// proxy configuration
|
||||
|
@ -5,6 +5,7 @@ class BrunoRequest {
|
||||
this.method = req.method;
|
||||
this.headers = req.headers;
|
||||
this.body = req.data;
|
||||
this.timeout = req.timeout;
|
||||
}
|
||||
|
||||
getUrl() {
|
||||
@ -50,6 +51,14 @@ class BrunoRequest {
|
||||
setMaxRedirects(maxRedirects) {
|
||||
this.req.maxRedirects = maxRedirects;
|
||||
}
|
||||
|
||||
getTimeout() {
|
||||
return this.req.timeout;
|
||||
}
|
||||
|
||||
setTimeout(timeout) {
|
||||
this.req.timeout = timeout;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BrunoRequest;
|
||||
|
Loading…
Reference in New Issue
Block a user