Skip to content

Library erroneously URI-encodes usersname and password#2093

Description

@JoshuaWise

Describe the bug

When Got builds an Authorization header for basic auth, it URI-encodes the username and password. This is not warranted by any spec, and it breaks requests that use special characters in their username or password.

Actual behavior

Got URI-encodes the username and password used in the Authorization header for basic auth.

Expected behavior

Got should send whatever username or password is specified by the user, without modification.

Code to reproduce

const client = Got.extend({
  username: process.env.AUTH_USER,
  password: process.env.AUTH_PASS,
});

await client.get(url);

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions