1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-25 17:17:12 +00:00
This commit is contained in:
LASER-Yi 2022-07-15 10:14:06 +08:00
parent 67259ec75d
commit 27d792041c

View file

@ -18,10 +18,16 @@ export const URLTestButton: FunctionComponent<{
const click = useCallback(() => {
if (address && apikey && ssl !== null) {
let testUrl: string;
let baseUrl = url;
if (baseUrl && baseUrl.startsWith("/") === false) {
baseUrl = "/" + baseUrl;
}
if (port) {
testUrl = `${address}:${port}${url ?? ""}`;
testUrl = `${address}:${port}${baseUrl ?? ""}`;
} else {
testUrl = `${address}${url ?? ""}`;
testUrl = `${address}${baseUrl ?? ""}`;
}
const request = {
protocol: ssl ? "https" : "http",