diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index 16886e930fa..f275001f162 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -107,7 +107,7 @@ class PublicPreviewController extends PublicShareController { $downloadForbidden = $attributes?->getAttribute('permissions', 'download') === false; // Is this header is set it means our UI is doing a preview for no-download shares // we check a header so we at least prevent people from using the link directly (obfuscation) - $isPublicPreview = $this->request->getHeader('X-NC-Preview') === 'true'; + $isPublicPreview = $this->request->getHeader('x-nc-preview') === 'true'; if ($isPublicPreview && $downloadForbidden) { // Only cache for 15 minutes on public preview requests to quickly remove from cache diff --git a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php index 9750274ff62..41789cdd138 100644 --- a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php +++ b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php @@ -144,7 +144,7 @@ class PublicPreviewControllerTest extends TestCase { ->willReturn($attributes); $this->request->method('getHeader') - ->with('X-NC-Preview') + ->with('x-nc-preview') ->willReturn('true'); $file = $this->createMock(File::class); @@ -184,7 +184,7 @@ class PublicPreviewControllerTest extends TestCase { ->willReturn($attributes); $this->request->method('getHeader') - ->with('X-NC-Preview') + ->with('x-nc-preview') ->willReturn('true'); $file = $this->createMock(File::class); diff --git a/apps/webhook_listeners/lib/Controller/WebhooksController.php b/apps/webhook_listeners/lib/Controller/WebhooksController.php index cf541487951..97bc8aa875e 100644 --- a/apps/webhook_listeners/lib/Controller/WebhooksController.php +++ b/apps/webhook_listeners/lib/Controller/WebhooksController.php @@ -137,7 +137,7 @@ class WebhooksController extends OCSController { ): DataResponse { $appId = null; if ($this->session->get('app_api') === true) { - $appId = $this->request->getHeader('EX-APP-ID'); + $appId = $this->request->getHeader('ex-app-id'); } try { $authMethod = AuthMethod::from($authMethod ?? AuthMethod::None->value); @@ -206,7 +206,7 @@ class WebhooksController extends OCSController { ): DataResponse { $appId = null; if ($this->session->get('app_api') === true) { - $appId = $this->request->getHeader('EX-APP-ID'); + $appId = $this->request->getHeader('ex-app-id'); } try { $authMethod = AuthMethod::from($authMethod ?? AuthMethod::None->value); @@ -271,7 +271,7 @@ class WebhooksController extends OCSController { /** * Remove all existing webhook registration mapped to an AppAPI app id * - * @param string $appid id of the app, as in the EX-APP-ID for creation + * @param string $appid id of the app, as in the ex-app-id for creation * * @return DataResponse * diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php index 41a45926ba7..e5edc165bf5 100644 --- a/core/Controller/AppPasswordController.php +++ b/core/Controller/AppPasswordController.php @@ -77,7 +77,7 @@ class AppPasswordController extends OCSController { $password = null; } - $userAgent = $this->request->getHeader('USER_AGENT'); + $userAgent = $this->request->getHeader('user-agent'); $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index 0e6e1fc8404..57ea20071b6 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -65,7 +65,7 @@ class ClientFlowLoginController extends Controller { } private function getClientName(): string { - $userAgent = $this->request->getHeader('USER_AGENT'); + $userAgent = $this->request->getHeader('user-agent'); return $userAgent !== '' ? $userAgent : 'unknown'; } diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php index 84212002895..8c0c1e8179d 100644 --- a/core/Controller/ClientFlowLoginV2Controller.php +++ b/core/Controller/ClientFlowLoginV2Controller.php @@ -293,7 +293,7 @@ class ClientFlowLoginV2Controller extends Controller { #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT)] public function init(): JSONResponse { // Get client user agent - $userAgent = $this->request->getHeader('USER_AGENT'); + $userAgent = $this->request->getHeader('user-agent'); $tokens = $this->loginFlowV2Service->createTokens($userAgent); diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index ea90be31078..7dd14b19f79 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -152,7 +152,7 @@ class PreviewController extends Controller { // Is this header is set it means our UI is doing a preview for no-download shares // we check a header so we at least prevent people from using the link directly (obfuscation) - $isNextcloudPreview = $this->request->getHeader('X-NC-Preview') === 'true'; + $isNextcloudPreview = $this->request->getHeader('x-nc-preview') === 'true'; $storage = $node->getStorage(); if ($isNextcloudPreview === false && $storage->instanceOfStorage(ISharedStorage::class)) { /** @var ISharedStorage $storage */