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 with & in query string only passes the first arg #9

Closed
laurence-myers opened this issue Jul 22, 2023 · 3 comments
Closed

URL with & in query string only passes the first arg #9

laurence-myers opened this issue Jul 22, 2023 · 3 comments

Comments

@laurence-myers
Copy link

laurence-myers commented Jul 22, 2023

Test case

On Windows 10 via PowerShell.

await open('https://www.google.com/search?sclient=gws-wiz&q=deno_open', { url: true })

Expected

Opens browser with URL https://www.google.com/search?sclient=gws-wiz&q=deno_open

Actual

Opens browser with URL https://www.google.com/search?sclient=gws-wiz

@skoshx
Copy link
Owner

skoshx commented Jul 23, 2023

Thanks for opening this issue!

I'm unable to reproduce this on macOS, so it's difficult to help with any kind of fix for now!

@laurence-myers
Copy link
Author

Looks like, in Windows, you just need to wrap the & char in quote marks, e.g. https://www.google.com/search?sclient=gws-wiz"&"q=deno_open. (Wrapping the whole string does not work.)

I've tested this in both Command Prompt and PowerShell.

C:\Users\...>start http://www.google.com/search?client=firefox-b-d&q=deno+open
'q' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\...>start http://www.google.com/search?client=firefox-b-d"&"q=deno+open
PS C:\Users\...> start http://www.google.com/search?client=firefox-b-d&q=deno+open
At line:1 char:54
+ start http://www.google.com/search?client=firefox-b-d&q=deno+open
+                                                      ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : AmpersandNotAllowed

PS C:\Users\...> start http://www.google.com/search?client=firefox-b-d"&"q=deno+open

@skoshx
Copy link
Owner

skoshx commented Jul 24, 2023

Haha, another interesting quirk of Windows it seems :D But thank you for taking your time to investigate this! I will add a note to the README!

@skoshx skoshx closed this as completed Jul 24, 2023
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