Fix browser extension URL mismatch + add support for sourcegraph custom baseURL with path
Created by: erzhtor
Closes https://github.com/sourcegraph/sourcegraph/issues/26170.
Description
It seems that in client GQL we didn't support a custom base-URL for self-hosted instances.
For example: https://my-org.com/sourcegraph
would trim /sourcegraph
and try to use only the domain part of the URL. I guess, nobody used a custom domain with a path as sourcegraph baseURL so far.
However, because ofthis user could put any URL in the browser extension, and it would validate and work for GQL requests, but links on the page would be constructed incorrectly.
How to test
- Browser extension
-
yarn --cwd client/browser dev:chrome
+ install extension in chrome - Open extension popup and check that URL input validates full URLL (doesn't ignore URL path)
- Open any public repo and check extension correctly works & builds links
-
- Web
- Run sourcegraph web locally (or fully) & and check that everything is working as expected
Screenshots
Before | After |
---|---|