thephpleague / oauth1-client

OAuth 1 Client
MIT License
968 stars 73 forks source link

baseString composition fails when port is specified in URI #123

Closed wgnann closed 4 years ago

wgnann commented 4 years ago

https://github.com/thephpleague/oauth1-client/blob/3a68155c3f27a91f4b66a2dc03996cd6f3281c9f/src/Signature/EncodesUrl.php#L37

Since $url->getHost() returns only the IP/DNS, a path like https://example.org:8080/oauth is signed as https://example.org/oauth, voiding the hash.

Thank you!

bencorlett commented 4 years ago

I have opened a PR to fix this in V1! I'm fairly sure the (unreleased) V2 does not suffer from this but I will also add a test to confirm.

bencorlett commented 4 years ago

Yep, v2 is not affected. I've added tests to prove the functionality works.

Thank you very much for the bug report!