Skip to content

Commit

Permalink
fix(settings): Use axios directly for health check to preven URL sani…
Browse files Browse the repository at this point in the history
…tizing

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 <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
susnux authored and kesselb committed Jul 3, 2024
1 parent 5649cdd commit 6e52a19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions apps/settings/src/store/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -186,13 +187,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(),
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

0 comments on commit 6e52a19

Please sign in to comment.