sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.28k forks source link

Unable to add a repository which has a plus sign (+) in the URL #15079

Closed dshcherb closed 3 years ago

dshcherb commented 3 years ago

Steps to reproduce:

Add a repository as follows:

{
  "url": "https://git.launchpad.net",
  "repos": ["ubuntu/+source/qemu"]
}

or with percent encoding:

{
  "url": "https://git.launchpad.net",
  "repos": ["ubuntu%2F%2Bsource%2Fqemu"]
}

Judging by this log message, the schema in the request_uri gets truncated:

t=2020-10-27T10:21:56+0000 lvl=eror msg="ui HTTP handler error response" method=GET request_uri=/git.launchpad.net/ubuntu/+source/qemu status_code=500 error="git command [git rev-parse HEAD] failed (stderr: \"\"): Post \"http://gitserver-0:3178/exec\": context canceled" error_id=HNV6BH trace=#tracer-not-enabled

Also, I tried using a URL-shortener and passing a shortened URL to sourcegraph and it handled redirection correctly and cloned the repository successfully albeit the repository name got mangled.

Expected behavior:

The repository gets cloned.

Actual behavior:

Getting the following shown in the UI:


The repository page was not found.```
github-actions[bot] commented 3 years ago

Heads up @tsenart - the "team/cloud" label was applied to this issue.