-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Prevent URL pollution #1243
Prevent URL pollution #1243
Conversation
Fixed username and password not copied to options if only in URL
Added some tests |
There's no documentation about if There's a test Is this an expected behavior? If not the URL should be deep-copied on each call to prevent pollution. https://github.com/sindresorhus/got/blob/master/source/core/index.ts#L583 Is only a 1 level deep copy, url is copied as a reference that is not enough. My suggestion is to add something like
after line 587 |
Seperately. E.g. a user can have an empty password. |
Not exactly object copy, but |
This also needs a separate test. |
Yes, I'm doing it |
Check this last commit |
Hint: |
This just needs a separate test to check against the pollution and we're good to go! :) |
Let's say I need to get used to git... :) BTW, I added a test, it's like the one which was failing, but simpler |
I've been there too ;)
Let me see it. |
Good job! Thanks 🙌 |
Checklist
Keeping in mind that
URL's
username
anspassword
are overwritten only if they're not empty (or null) in options.I'm going to add some tests.
Fixes #1235