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 case where the user info are added dispite empty #284

Closed
wants to merge 1 commit into from

Conversation

gmponos
Copy link
Member

@gmponos gmponos commented Jul 3, 2019

Check failing test here , guzzle/guzzle#2327

@Tobion
Copy link
Member

Tobion commented Jul 4, 2019

This is not according to rfc 3986

Applications should not render as clear text any data
after the first colon (":") character found within a userinfo
subcomponent unless the data after the colon is the empty string
(indicating no password)

@gmponos
Copy link
Member Author

gmponos commented Jul 4, 2019

I am not sure if I follow. At the moment if I do something like this:

        $uri = (new Uri('http://example.org/path'))->withUserInfo('', '');
        echo (string)$uri;

It will output http://:@example.org/path

Is this correct?

@Tobion
Copy link
Member

Tobion commented Jul 30, 2019

http://:@example.org/path is a valid URI and browsers do accept it as well. It's basic auth with empty username and no password. There is not much use to it but it's valid.
Why not call withUserInfo('', null) or just withUserInfo('')? That would be the right thing to do as the default for password is null which means, no password.

@gmponos
Copy link
Member Author

gmponos commented Aug 3, 2019

Thank you.. I did not knew about this. I pushed a fixed to Guzzle client at the PR I mentioned above..

@gmponos gmponos closed this Aug 3, 2019
@sagikazarmark
Copy link
Member

@Tobion this still seems to be a regression to me (as mentioned in #290), but I'm inclined to leave it as is if there is no real case where this can cause problems (except in the breaking tests).

@gmponos gmponos deleted the fix-user-info branch December 23, 2019 20:36
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.

None yet

3 participants