microsoft / microsoft/dev-tunnels

Wrong encoding in the URI path of PF request

Open
#492 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
508
Forks
52
Avg merge
20h 6m
Merged PRs (30d)
7

Description

Dev Tunnels service seems to be doing a wrong formatting of the URI when forwarding a request to the host.
This is an example of accessing a forwarded port with a path through a web client:

Image

Note that %40 is for some reason being unencoded and sent to the Codespace application as @, the %2F becomes %252F.

Repro steps:

  1. Create a codespace from https://github.com/github/codespaces-express
  2. Wait for app to start and forward port 3000
  3. Access the forwarded URL on a non-existing encoded path, for example: /one%2Ftwo
  4. Note error message Cannot GET /one%252Ftwo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the forwarded request with the codespaces-express app and path /one%2Ftwo, then trace how Dev Tunnels formats the URI before forwarding it to the host. Done means the encoded path reaches the application without %40 being decoded or %2F being double-encoded, and the reported error no longer shows /one%252Ftwo.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.