Skip to content

Preserve empty strings in HTTP Basic authentication credentials - #2647

Open
Shubham-Padkonde wants to merge 1 commit into
winstonjs:masterfrom
Shubham-Padkonde:fix/http-empty-basic-credentials
Open

Shubham-Padkonde wants to merge 1 commit into
winstonjs:masterfrom
Shubham-Padkonde:fix/http-empty-basic-credentials

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

The HTTP transport omits Basic authentication whenever either credential is an empty string. This breaks endpoints that use a token as the username with an empty password, or the inverse, even though both are valid Basic credentials.

Check that both credentials are strings instead of requiring them to be truthy. Add real local HTTP-server tests that inspect the outgoing Authorization header for an empty username, an empty password, both empty, and ordinary credentials.

Three regressions fail before the fix. All 74 HTTP transport and logger tests pass afterward (one existing todo). The full lint command passes with ten existing warnings and no errors.

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 this pull request may close these issues.

1 participant