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

URL parse treats semicolons ; as query param separators #2

Open
digeomel opened this issue Sep 2, 2024 · 2 comments
Open

URL parse treats semicolons ; as query param separators #2

digeomel opened this issue Sep 2, 2024 · 2 comments

Comments

@digeomel
Copy link

digeomel commented Sep 2, 2024

Hello, I know this plugin is old and probably abandoned, but I just noticed what I consider a bug, specifically, it seems to split URL query params not only on the ampersand & (to be precise, ampersand not followed by a hex code), but also on the semicolon ;.

I looked at the code and it seems to be caused by the use of the Python urllib, as described in this question:

https://stackoverflow.com/questions/5158565/why-does-pythons-urlparse-parse-qs-split-arguments-on-semicolon

Looking into the code, it seems that the plugin uses the urllib.parse.urlparse function:

parsed = urlparse(s)

which doesn't accept options for the separators, while the urllib.parse.parse_qs and urllib.parse.parse_qsl functions do, and it defaults to only the ampersand, as it should:

https://docs.python.org/3/library/urllib.parse.html

So, any chance this might be updated?

Thanks in advance!

@ulasozguler
Copy link
Owner

Hi,

As you have guessed, I'm not really maintaining this plugin anymore. I'm not even using Sublime text. If you create a PR that fixes the problem, I can publish a new version. But I don't intend to look into this myself.

If you are also using VS Code, I ported this plugin to there too. It doesn't have the problem you mentioned. plugin page | source code

@digeomel
Copy link
Author

digeomel commented Sep 2, 2024

Thank you for your reply. I use vscode as my main IDE, but I still use Sublime Text as a lightweight editor for simple things such as this. I will check your vscode extension.

In the meantime, I am not a Python developer, but I have been wanting to learn for a long time now, and this looks like a nice way to do it 😄 If nobody else picks it up before me, maybe I will make a PR in my free time.

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

No branches or pull requests

2 participants