mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
possible a good fix
This commit is contained in:
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}\\index"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -44,6 +44,27 @@ const Login: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
// add a test that checks if the url contains http/https
|
||||
if (_apiUrl.startsWith("http") || _apiUrl.startsWith("https")) {
|
||||
{
|
||||
setServer({
|
||||
address: _apiUrl,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//check if url requires ssl
|
||||
// use curl to see if https is required
|
||||
// if not use http
|
||||
// if yes use https
|
||||
const test = fetch("http://jellyfin.oakgrove.site/web/#/home.html")
|
||||
.then((response) => console.log(response))
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
const test2 = fetch("https://jellyfin.oakgrove.site/web/#/home.html")
|
||||
.then((response) => console.log(response))
|
||||
.catch((error) => console.error(error));
|
||||
}
|
||||
|
||||
if (_apiUrl) {
|
||||
setServer({
|
||||
address: _apiUrl,
|
||||
|
||||
Reference in New Issue
Block a user