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

RequestHeaders.Authorization parameter concatenation failed #3286

Closed
Allanbcruz opened this issue Sep 13, 2020 · 0 comments · Fixed by #3287
Closed

RequestHeaders.Authorization parameter concatenation failed #3286

Allanbcruz opened this issue Sep 13, 2020 · 0 comments · Fixed by #3287

Comments

@Allanbcruz
Copy link
Contributor

Describe the bug

In situations that use Basic auth and do not pass the parameter "password" requestHeaders.Authorization is concatenated unduly ": undefined".

To Reproduce

Any request using Basic Authentication without passing the parameter "password" as an example below.

var axios = require("axios")
const instance = axios.create();
instance.request({
    method: 'POST',
    baseURL: ".../XPTO",
    auth: { username: "janedoe" }}
    ).then(
        // do something
    );

Expected behavior

To maintain compatibility with previous versions, the proper behavior would be to test if the parameter "password" was passed, otherwise concatenate empty.

Environment

  • Axios Version [e.g. 0.20.0]
  • Adapter [e.g. XHR/HTTP]
  • Browser [e.g. Chrome, Safari]
  • Browser Version [e.g. 22]
  • Node.js Version [e.g. 13.0.1]
  • OS: [e.g. iOS 12.1.0, OSX 10.13.4]
  • Additional Library Versions [e.g. React 16.7, React Native 0.58.0]

Additional context/Screenshots

A problem arising from the lack of compatibility with previous versions is to force all current projects that do not pass a "password" parameter to have to include this parameter with an empty value.

Allanbcruz added a commit to Allanbcruz/axios that referenced this issue Sep 13, 2020
Correction of the requestHeaders.Authorization parameter concatenation.

Close axios#3286.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant