Unable to add a repository which has a plus sign (+) in the URL
Created by: dshcherb
- Sourcegraph version: 3.21.2, deployed via deploy-sourcegraph-docker (HEAD at v3.21.2)
- Platform information: Ubuntu 20.04, Docker version 19.03.13, build 4484c46d9d (Docker CE installed from https://download.docker.com/linux/ubuntu)
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.```