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

The node_internals _http_client.js emit a warn #2633

Closed
wang-ran opened this issue Jan 2, 2020 · 1 comment
Closed

The node_internals _http_client.js emit a warn #2633

wang-ran opened this issue Jan 2, 2020 · 1 comment

Comments

@wang-ran
Copy link

wang-ran commented Jan 2, 2020

Describe the bug
I use axios.get method with custom httpsAgent and httpAgent in node.js. The node_internals _http_client.js emit a warn when the server response http statue code 302 and headers location's protocol is different with the initiator url's protocol.

To Reproduce
Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question

// Example code here
const axios = require("axios");
const https = require("https");
const http = require("http");
const httpsAgent = new https.Agent({keepAlive: true})
const httpAgent = new http.Agent({keepAlive: true})
const url = 'https://xxxxx';
axios
  .get(url, {
    httpsAgent,
    httpAgent
  })
  .then(() => {
    console.log("success");
  })
  .catch(() => {
    console.error("error:");
  });

I had read the axios' code , the httpFollow and httpsFollow's options should includes customer's agent

Expected behavior
axios use a new agent adapter the redirect url protocol

Environment:

  • Axios Version: 0.19.0
  • Node Version: v12.14.0

Additional context/Screenshots
image

@chinesedfan
Copy link
Collaborator

Duplicate of #1981. Can you check v0.19.1?

@axios axios locked and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants