cleanup netlify.toml + add logging

This commit is contained in:
Marc 2025-03-02 11:17:26 +01:00
parent e62a0b720b
commit e20ca4654f
2 changed files with 6 additions and 7 deletions

View File

@ -7,18 +7,15 @@
to = "https://try.vikunja.io/api/:splat"
status = 200
force = true
headers = {X-Debug-Redirect = "api-rule"}
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
headers = {X-Debug-Redirect = "all-to-index"}
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Robots-Tag = "noindex"
X-Debug = "global-debug"
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Robots-Tag = "noindex"

View File

@ -20,7 +20,8 @@ export class InvalidApiUrlProvidedError extends Error {
}
}
export const checkAndSetApiUrl = (url: string | undefined | null): Promise<string> => {
export const checkAndSetApiUrl = (pUrl: string | undefined | null): Promise<string> => {
let url = pUrl
if (url === '' || url === null || typeof url === 'undefined') {
throw new NoApiUrlProvidedError()
}
@ -55,6 +56,7 @@ export const checkAndSetApiUrl = (url: string | undefined | null): Promise<strin
// Check if the api is reachable at the provided url
return configStore.update()
.catch(e => {
console.warn(`Could not fetch 'info' from the provided endpoint ${pUrl} on ${window.API_URL}/info. Some automatic fallback will be tried.`)
// Check if it is reachable at /api/v1 and http
if (
!urlToCheck.pathname.endsWith('/api/v1') &&