mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-26 01:27:07 +00:00
Fix #1904
This commit is contained in:
parent
67259ec75d
commit
27d792041c
1 changed files with 8 additions and 2 deletions
|
@ -18,10 +18,16 @@ export const URLTestButton: FunctionComponent<{
|
||||||
const click = useCallback(() => {
|
const click = useCallback(() => {
|
||||||
if (address && apikey && ssl !== null) {
|
if (address && apikey && ssl !== null) {
|
||||||
let testUrl: string;
|
let testUrl: string;
|
||||||
|
|
||||||
|
let baseUrl = url;
|
||||||
|
if (baseUrl && baseUrl.startsWith("/") === false) {
|
||||||
|
baseUrl = "/" + baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
if (port) {
|
if (port) {
|
||||||
testUrl = `${address}:${port}${url ?? ""}`;
|
testUrl = `${address}:${port}${baseUrl ?? ""}`;
|
||||||
} else {
|
} else {
|
||||||
testUrl = `${address}${url ?? ""}`;
|
testUrl = `${address}${baseUrl ?? ""}`;
|
||||||
}
|
}
|
||||||
const request = {
|
const request = {
|
||||||
protocol: ssl ? "https" : "http",
|
protocol: ssl ? "https" : "http",
|
||||||
|
|
Loading…
Reference in a new issue