From 00c077be56aaf94a86e5438ca78009bf783c1d4b Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 10 Jun 2024 16:08:50 +0200 Subject: [PATCH] fix(settings): Use axios directly for health check to preven URL sanitizing When using Apache with `DirectorySlash` it will respond with 301 and the URL with trailing slash. But when using traefik as the reverse proxy it can not rewrite redirects, this leads to the problem that the Apache response is using HTTP in the redirect but the real server (traefik) is only listening on HTTPS. Signed-off-by: Ferdinand Thiessen --- apps/settings/src/store/apps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/settings/src/store/apps.js b/apps/settings/src/store/apps.js index 17e5d74be93..b2ec07f78a2 100644 --- a/apps/settings/src/store/apps.js +++ b/apps/settings/src/store/apps.js @@ -24,6 +24,7 @@ import api from './api.js' import Vue from 'vue' +import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' import { showError, showInfo } from '@nextcloud/dialogs' import { loadState } from '@nextcloud/initial-state' @@ -197,13 +198,13 @@ const actions = { }) // check for server health - return api.get(generateUrl('apps/files/')) + return axios.get(generateUrl('apps/files/')) .then(() => { if (response.data.update_required) { showInfo( t( 'settings', - 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.' + 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.', ), { onClick: () => window.location.reload(), -- 2.39.5