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

fix: preserve basic auth in nodejs if present #66

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

garbados
Copy link
Contributor

This PR closes #64 by using the username and password values parsed from the request URL to populate the auth option used by nodejs http/s.

@garbados
Copy link
Contributor Author

garbados commented Feb 19, 2020

I didn't include a test because this modifies the nodejs.js file, which is not tested by the test suite. I did try, but the core mkrequest method rejects basic auth that hasn't been converted to a header:

TypeError: Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: http://admin:password@localhost:5984

@mikeal
Copy link
Owner

mikeal commented Feb 19, 2020

I didn't include a test because this modifies the nodejs.js file, which is not tested by the test suite.

It’s definitely tested, including coverage testing.

@mikeal mikeal merged commit c959692 into mikeal:master Feb 19, 2020
@mikeal
Copy link
Owner

mikeal commented Feb 19, 2020

Ok, I pulled this down, added a test and got it working for browsers as well.

@garbados
Copy link
Contributor Author

It’s definitely tested, including coverage testing.

Sorry, you're right. I misread the instrumentation.

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.

Bent ignores "username:password" basic auth
2 participants