server icon indicating copy to clipboard operation
server copied to clipboard

[stable28] fix(settings): define a 'heartbeat' route, so SecurityHeaders can handle redirected root

Open backportbot[bot] opened this issue 1 year ago • 1 comments

Backport of PR #45228

backportbot[bot] avatar Jun 18 '24 15:06 backportbot[bot]

Is this route actually used in NC28?

The security headers check was migrated in NC29. Previously OC.generateUrl('heartbeat') was used.

MichaIng avatar Jun 30 '24 14:06 MichaIng

Is this route actually used in NC28?

The security headers check was migrated in NC29. Previously OC.generateUrl('heartbeat') was used.

It’s cleaner to have the route in the system since it exists. And if the migration of the check is ever backported we won’t get a bug from it.

come-nc avatar Jul 01 '24 08:07 come-nc

Pushed https://github.com/nextcloud/server/pull/45955/commits/b5cf0992a2e166080ab8c186cf499360e565e141 to fix the failing test.

The router uses include_once to load route definitions from the apps.

First include_once for apps/files/appinfo/routes.php returns the expected array.

Second include_once returns true, because the file was already included.

To workaround the tests must run in a separate process.

I have no idea why the test is not failing on master.

kesselb avatar Jul 10 '24 14:07 kesselb

To workaround the tests must run in a separate process.

That does not seem to work

I have no idea why the test is not failing on master.

The test is not failing on master because the app manager instance is mocked, the app path is null and the routing file not even included: https://github.com/nextcloud/server/pull/46416

kesselb avatar Jul 10 '24 15:07 kesselb