-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Is your feature request related to a problem? Please describe.
Axios 0.21.1 does not cope with requests through proxy to secured URLs - HTTP code 501 is received.
I'm behind corporate network. When I try to launch the following code, the error 501 is received:
const axios = require("axios");
axios.get('https://jsonplaceholder.typicode.com/todos/12', {
proxy: {
protocol: 'http',
host: 'corporate.proxy',
port: 9000
},
})
.then(response => response.data)
.then(data => console.log(data))
.catch((error) => {
const errorMessage = error.message;
const responseData = error.response && error.response.data;
console.log('error')
console.log(`${errorMessage}${
responseData
&& typeof responseData === 'object'
? `: ${JSON.stringify(responseData)}`
: ''}`)
});
Requests made to unsecured URLs - http protocol - with or without proxy settings succeed.
Describe the solution you'd like
Fix or implement please a possibility to perform requests to secured URLs - https protocol - through proxy.
Describe alternatives you've considered
Instead of using "axios" module, the module "axios-https-proxy-fix" solves the issue. However, it's some old fix. And most probably does not update to new features that original Axios may bring. Definitely I would like to stick to primary.
Additional context
No solution is found around the original source.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels