Double forward slash in Find references link in the Browser Extensions
Created by: ducher
Steps to reproduce:
- Hover a function with the browser extension activated
- The link generated contains 2 forward slashes after the domain name ( https://sourcegraph.com//github.com/sourcegraph/sourcegraph@5b9362940c84ca79c2ca277b9b1d5bbbccb47d3b/-/blob/shared/src/util/url.ts#L455:17&tab=references )
It works on the sourcegraph server but not on my own as the official sourcegraph server probably rewrites the URL to ignore the duplicate slash.
The issue is that we concatenate two '/' in the toAbsoluteBlobURL function, as the toPrettyBlobURL always returns a string begining with a '/' : https://github.com/sourcegraph/sourcegraph/blob/5b9362940c84ca79c2ca277b9b1d5bbbccb47d3b/client/browser/src/shared/util/url.tsx#L18 and https://github.com/sourcegraph/sourcegraph/blob/5b9362940c84ca79c2ca277b9b1d5bbbccb47d3b/shared/src/util/url.ts#L458
Expected behavior:
Have a valid URL (https://sourcegraph.com/github.com/sourcegraph/sourcegraph@5b9362940c84ca79c2ca277b9b1d5bbbccb47d3b/-/blob/shared/src/util/url.ts#L455:17&tab=references)
Actual behavior:
The link is invalid and sourcegraph doesnt find the file.