Skip to content

Support URL specific encodings (query component) #25852

Closed

Description

Hello Support,

When clicking a link in VSCode, the URL is incorrectly unescaped prior to handing the request to the browser.

Example URL pasted into VSCode:
http://www.test.com/path/service?authId=CN%3DQ10

Result - the '%3D' is unescaped to '=' when you Ctrl-Click:
GET /path/service?authId=CN=Q10 HTTP/1.1

Please review and correct.

Regards,
Jeff Woehler

  • VSCode Version: Code 1.11.2 (6eaebe3, 2017-04-13T08:03:11.395Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:
Extension Author Version
xml DotJoshJohnson 1.7.0
beautify HookyQR 1.0.2
csharp ms-vscode 1.8.1
debugger-for-chrome msjsdiag 3.0.1

Steps to Reproduce:

Activity

  1. added
    bug
    on Aug 11, 2017
  2. added
    feature-request
    and removed
    bug
    on Oct 30, 2017
  3. humphd commented on Oct 22, 2018

    @humphd
  4. jrieken commented on Oct 22, 2018

    @jrieken
  5. humphd commented on Oct 22, 2018

    @humphd

    If you decode %2F to / at this point, it's now part of the path and not data in the path, and there's nothing you can do later with toString() that will allow you to recover it.

    Anyway, just trying to help. Sounds like that's not wanted, so I'll leave this to you.

  6. kaleidawave commented on Feb 10, 2019

    @kaleidawave

    This issue is still present in 1.31.0 and have had this issue many times with the '%2F' string being changed to '/' when forwarded to Google Chrome. This is a big issue for firebase storage as it cannot locate the resource if there is a forward slash. In the mean time is there a way of circumventing this by changing the contents of the logging function.

  7. StephenWeatherford commented on Apr 18, 2019

    @StephenWeatherford

    Johannes - We see you merged a change related to this yesterday. Unfortunately, it does not fix the issue for us. This is an actual URL generated by our extension. It should open a new issue in github:

    ISSUE 1:
    https://github.com/Microsoft/vscode-azurearmtools/issues/new?body=%0A%3C!--%20IMPORTANT%3A%20Please%20be%20sure%20to%20remove%20any%20private%20information%20before%20submitting.%20--%3E%0A%0ARepro%20steps%3A%0A%3C!--%20TODO%3A%20Enter%20steps%20to%20reproduce%20issue%20--%3E%0A%0A1.%0A2.%0A%0AAction%3A%20startArmLanguageClient%0AError%20type%3A%20Error%0AError%20Message%3A%20hi%0A%0AVersion%3A%200.5.1-alpha%0AOS%3A%20win32%0AProduct%3A%20Visual%20Studio%20Code%20-%20Insiders%0AProduct%20Version%3A%201.34.0-insider%0ALanguage%3A%20en%0A%0A%3Cdetails%3E%0A%3Csummary%3ECall%20Stack%3C%2Fsummary%3E%0A%0A%60%60%60%0AObject.vscode_azureextensionui_1.callWithTelemetryAndErrorHandlingSync%20(startArmLanguageServer.js%3A17%3A15)%0AObject.callWithTelemetryAndErrorHandlingSync%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A46%3A25)%0AObject.startArmLanguageServer%20(startArmLanguageServer.js%3A16%3A31)%0AAzureRMTools.ensureDeploymentTemplateEventsHookedUp%20(out%2Fsrc%2FAzureRMTools.js%3A226%3A34)%0AObject.%5Banonymous%20(out%2Fsrc%2FAzureRMTools.js%3A128%3A24)%0AObject.callWithTelemetryAndErrorHandlingSync%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A46%3A25)%0AAzureRMTools.updateDeploymentTemplate%20(out%2Fsrc%2FAzureRMTools.js%3A110%3A35)%0Anew%20AzureRMTools%20(out%2Fsrc%2FAzureRMTools.js%3A88%3A18)%0AObject.%5Banonymous%5D%20(out%2Fsrc%2FAzureRMTools.js%3A45%3A44)%0AGenerator.next%20(%5Banonymous%5D)%0A__awaiter%20(out%2Fsrc%2FAzureRMTools.js%3A10%3A71)%0Anew%20Promise%20(%5Banonymous%5D)%0A__awaiter%20(out%2Fsrc%2FAzureRMTools.js%3A6%3A12)%0AObject.%5Banonymous%5D%20(out%2Fsrc%2FAzureRMTools.js%3A41%3A20)%0AObject.%5Banonymous%5D%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A61%3A51)%0AGenerator.next%20(%5Banonymous%5D)%0A__awaiter%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A11%3A71)%0Anew%20Promise%20(%5Banonymous%5D)%0A__awaiter%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A7%3A12)%0AObject.callWithTelemetryAndErrorHandling%20(node_modules%2Fvscode-azureextensionui%2Fout%2Fsrc%2FcallWithTelemetryAndErrorHandling.js%3A58%3A12)%0AObject.%5Banonymous%5D%20(out%2Fsrc%2FAzureRMTools.js%3A40%3A41)%0AGenerator.next%20(%5Banonymous%5D)%0A__awaiter%20(out%2Fsrc%2FAzureRMTools.js%3A10%3A71)%0Anew%20Promise%20(%5Banonymous%5D)%0A__awaiter%20(out%2Fsrc%2FAzureRMTools.js%3A6%3A12)%0AObject.activateInternal%20(out%2Fsrc%2FAzureRMTools.js%3A34%3A12)%0Aactivate%20(main.js%3A24%3A28)%0AFunction._callActivateOptional%20(AppData%2FLocal%2FPrograms%2FMicrosoft%20VS%20Code%20extensionHostProcess.js%3A725%3A689)%0AFunction._callActivate%20(AppData%2FLocal%2FPrograms%2FMicrosoft%20VS%20Code%20extensionHostProcess.js%3A725%3A378)%0Adefine._doActivateExtension.Promise.all.then.e%20(AppData%2FLocal%2FPrograms%2FMicrosoft%20VS%20Code%20extensionHostProcess.js%3A724%3A569)%0A%60%60%60%0A%0A%3C%2Fdetails%3E

    Expected result: Working New Issue page
    Actual result: Blank page or error 500

    Opening this through the "opn" npm module works fine. But if you send this through vscode.open, or if you just enter it into a vscode editor and do CTRL+CLICK, it brings up a blank page in Edge and shows a 500 error in Chrome.

    ISSUE 2:
    The following shortened URL (without the stack) does bring up the New Issues page, but the newlines are missing:

    https://github.com/Microsoft/vscode-azurearmtools/issues/new?body=%0A%3C!--%20IMPORTANT%3A%20Please%20be%20sure%20to%20remove%20any%20private%20information%20before%20submitting.%20--%3E%0A%0ARepro%20steps%3A%0A%3C!--%20TODO%3A%20Enter%20steps%20to%20reproduce%20issue%20--%3E%0A%0A1.%0A2.%0A%0AAction%3A%20startArmLanguageClient%0AError%20type%3A%20Error%0AError%20Message%3A%20hi%0A%0AVersion%3A%200.5.1-alpha%0AOS%3A%20win32%0AProduct%3A%20Visual%20Studio%20Code%20-%20Insiders%0AProduct%20Version%3A%201.34.0-insider%0ALanguage%3A%20en%0A%0A%3Cdetails%3E%0A%3Csummary%3ECall%20

    Expected result:
    image

    Actual result:
    image

  8. 16 remaining items

  9. 928PJY commented on Oct 22, 2019

    @928PJY

    Hi Johannes Rieken (@jrieken), is that any update about this issue? is that any workaround about this issue? I notice that you have removed the Bug tag, so just want to know will you take this as a high priority problem or not?

  10. jrieken commented on Oct 22, 2019

    @jrieken
    Contributor

    Good timing Jiayin Pei (@928PJY) - the issue is very complex but I happen to be looking at this. My current work and progress is in #83060. No promises but the problem is acknowledged and understood but also far from easy to fix.

  11. jrieken commented on Oct 24, 2019

    @jrieken
    Contributor

    Implemented via #83060

  12. added
    verification-needed
    on Oct 28, 2019
  13. jrieken commented on Oct 28, 2019

    @jrieken
    Contributor

    Verifier: Have links like https://github.com/Microsoft/vscode/issues?q=is%3Aopen+assignee%3Ajrieken+milestone%3A%22October+2019%22 and make sure they can be opened as-is, e.g no double encoding etc

  14. added
    verified
    on Oct 29, 2019
  15. jrieken commented on Oct 30, 2019

    @jrieken
    Contributor

    re-open via 58479e8

  16. jrieken commented on Oct 30, 2019

    @jrieken
    Contributor

    /duplicate of #83645

    Closing this as a duplicate of #83645 which is all about finding a way out of the URI nightmare.

  17. added
    *duplicate
    on Oct 30, 2019
  18. vscodebot commented on Oct 30, 2019

    @vscodebot

    Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

    Happy Coding!

  19. locked and limited conversation to collaborators on Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatefeature-requesturiverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions