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

Fixed a bug with + in query #2364

Merged
merged 1 commit into from
Jun 8, 2019
Merged

Fixed a bug with + in query #2364

merged 1 commit into from
Jun 8, 2019

Conversation

HirbodBehnam
Copy link
Contributor

@HirbodBehnam HirbodBehnam commented May 31, 2019

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly

  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])

  • Use Preview tab to see how your pull request will actually look like

  • Searched for similar pull requests

  • Compiled the code with Visual Studio

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New feature

Description of your pull request and other information

Hello
At first when getting a key value from NameValueCollection the URL will be decoded automatically. So there is no need of HttpUtility.UrlDecode.
Secondly, try to parse this ss:// URL with Import URL From Clipboard:

ss://cmM0LW1kNTpQRzh2OXpHMFJiVkJDQnpm@1.1.1.1:443?plugin=ck-client%3bUID%3dIprWshnjXx3mS3wnWsIFfcvgcvwt4%2bFcoN7%2bIBZA8nU%5c%3d%3bPublicKey%3dD9baLw4qzRhqUDWyyYvuGBTWUP5Tr0NywoB5%2bkbRtWU%5c%3d%3bServerName%3dbing.com%3bTicketTimeHint%3d3600%3bMaskBrowser%3dchrome%3bNumConn%3d4

If you go to shadowsocks server's configs and look for plugin options you will notice that there is some white spaces. This is unexpected behavior because these white spaces should be + and somehow HttpUtility.UrlDecode are replacing them with white space. So with this build I can successfully import my config without any issues.
Also you can try decoding the parameter(from ? to end) here. Notice the + signs.

@HirbodBehnam
Copy link
Contributor Author

Plus I could not build the project unless I remove FodyWeavers.xml on Visual Studio 2019, .Net Framework 4.6.2

@celeron533
Copy link
Contributor

Thank you for detecting and fixing this defect! @HirbodBehnam !

@celeron533 celeron533 added the bug label Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants