diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index 16886e930fa2e..f275001f1628f 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -107,7 +107,7 @@ public function getPreview( $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/openapi.json b/apps/files_sharing/openapi.json index 89c8284393961..627c25ce8ea33 100644 --- a/apps/files_sharing/openapi.json +++ b/apps/files_sharing/openapi.json @@ -1492,7 +1492,7 @@ } }, { - "name": "X-NC-Preview", + "name": "x-nc-preview", "in": "header", "schema": { "type": "string" diff --git a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php index 9750274ff627f..41789cdd1389a 100644 --- a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php +++ b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php @@ -144,7 +144,7 @@ public function testShareNoDownloadButPreviewHeader() { ->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 @@ public function testShareWithAttributes() { ->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 cf5414879519c..97bc8aa875eb5 100644 --- a/apps/webhook_listeners/lib/Controller/WebhooksController.php +++ b/apps/webhook_listeners/lib/Controller/WebhooksController.php @@ -137,7 +137,7 @@ public function create( ): 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 @@ public function update( ): 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 @@ public function destroy(int $id): DataResponse { /** * 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/apps/webhook_listeners/openapi.json b/apps/webhook_listeners/openapi.json index 84610d204bb90..340d2d21337ae 100644 --- a/apps/webhook_listeners/openapi.json +++ b/apps/webhook_listeners/openapi.json @@ -256,7 +256,7 @@ }, "parameters": [ { - "name": "EX-APP-ID", + "name": "ex-app-id", "in": "header", "schema": { "type": "string" @@ -556,7 +556,7 @@ } }, { - "name": "EX-APP-ID", + "name": "ex-app-id", "in": "header", "schema": { "type": "string" @@ -809,7 +809,7 @@ { "name": "appid", "in": "path", - "description": "id of the app, as in the EX-APP-ID for creation", + "description": "id of the app, as in the ex-app-id for creation", "required": true, "schema": { "type": "string" diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php index 41a45926ba7d4..e5edc165bf503 100644 --- a/core/Controller/AppPasswordController.php +++ b/core/Controller/AppPasswordController.php @@ -77,7 +77,7 @@ public function getAppPassword(): DataResponse { $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 0e6e1fc8404ec..57ea20071b623 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -65,7 +65,7 @@ public function __construct( } 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 8421200289504..8c0c1e8179d92 100644 --- a/core/Controller/ClientFlowLoginV2Controller.php +++ b/core/Controller/ClientFlowLoginV2Controller.php @@ -293,7 +293,7 @@ private function handleFlowDone(bool $result): StandaloneTemplateResponse { #[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 ea90be31078ee..7dd14b19f79e8 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -152,7 +152,7 @@ private function fetchPreview( // 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 */ diff --git a/core/openapi-full.json b/core/openapi-full.json index 298be2e59d804..5edb86992dc3a 100644 --- a/core/openapi-full.json +++ b/core/openapi-full.json @@ -1173,7 +1173,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" @@ -8066,7 +8066,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" diff --git a/core/openapi.json b/core/openapi.json index 7462890bb4b79..5f9178202eb92 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -1173,7 +1173,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" @@ -8066,7 +8066,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" diff --git a/openapi.json b/openapi.json index b7350b4b1fa70..88d8450bd43f9 100644 --- a/openapi.json +++ b/openapi.json @@ -4645,7 +4645,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" @@ -11585,7 +11585,7 @@ ], "parameters": [ { - "name": "USER_AGENT", + "name": "user-agent", "in": "header", "schema": { "type": "string" @@ -19842,7 +19842,7 @@ } }, { - "name": "X-NC-Preview", + "name": "x-nc-preview", "in": "header", "schema": { "type": "string" @@ -30808,7 +30808,7 @@ }, "parameters": [ { - "name": "EX-APP-ID", + "name": "ex-app-id", "in": "header", "schema": { "type": "string" @@ -31108,7 +31108,7 @@ } }, { - "name": "EX-APP-ID", + "name": "ex-app-id", "in": "header", "schema": { "type": "string" @@ -31361,7 +31361,7 @@ { "name": "appid", "in": "path", - "description": "id of the app, as in the EX-APP-ID for creation", + "description": "id of the app, as in the ex-app-id for creation", "required": true, "schema": { "type": "string" diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php index b33033edac3a3..eb1566eca8be0 100644 --- a/tests/Core/Controller/AppPasswordControllerTest.php +++ b/tests/Core/Controller/AppPasswordControllerTest.php @@ -123,7 +123,7 @@ public function testGetAppPassword(): void { $credentials->method('getLoginName') ->willReturn('myLoginName'); $this->request->method('getHeader') - ->with('USER_AGENT') + ->with('user-agent') ->willReturn('myUA'); $this->random->method('generate') ->with( @@ -164,7 +164,7 @@ public function testGetAppPasswordNoPassword(): void { $credentials->method('getLoginName') ->willReturn('myLoginName'); $this->request->method('getHeader') - ->with('USER_AGENT') + ->with('user-agent') ->willReturn('myUA'); $this->random->method('generate') ->with( diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index b10055ef542f4..c9ccf9ac674e5 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -119,7 +119,7 @@ public function testShowAuthPickerPageWithOcsHeader(): void { $this->request ->method('getHeader') ->willReturnMap([ - ['USER_AGENT', 'Mac OS X Sync Client'], + ['user-agent', 'Mac OS X Sync Client'], ['OCS-APIREQUEST', 'true'], ]); $this->random @@ -178,7 +178,7 @@ public function testShowAuthPickerPageWithOauth(): void { $this->request ->method('getHeader') ->willReturnMap([ - ['USER_AGENT', 'Mac OS X Sync Client'], + ['user-agent', 'Mac OS X Sync Client'], ['OCS-APIREQUEST', 'false'], ]); $client = new Client(); @@ -555,7 +555,7 @@ public static function dataGeneratePasswordWithHttpsProxy(): array { [ ['X-Forwarded-Proto', 'http'], ['X-Forwarded-Ssl', 'off'], - ['USER_AGENT', ''], + ['user-agent', ''], ], 'http', 'http', @@ -564,7 +564,7 @@ public static function dataGeneratePasswordWithHttpsProxy(): array { [ ['X-Forwarded-Proto', 'http'], ['X-Forwarded-Ssl', 'off'], - ['USER_AGENT', ''], + ['user-agent', ''], ], 'https', 'https', @@ -573,7 +573,7 @@ public static function dataGeneratePasswordWithHttpsProxy(): array { [ ['X-Forwarded-Proto', 'https'], ['X-Forwarded-Ssl', 'off'], - ['USER_AGENT', ''], + ['user-agent', ''], ], 'http', 'https', @@ -582,7 +582,7 @@ public static function dataGeneratePasswordWithHttpsProxy(): array { [ ['X-Forwarded-Proto', 'https'], ['X-Forwarded-Ssl', 'on'], - ['USER_AGENT', ''], + ['user-agent', ''], ], 'http', 'https', @@ -591,7 +591,7 @@ public static function dataGeneratePasswordWithHttpsProxy(): array { [ ['X-Forwarded-Proto', 'http'], ['X-Forwarded-Ssl', 'on'], - ['USER_AGENT', ''], + ['user-agent', ''], ], 'http', 'https', diff --git a/tests/Core/Controller/PreviewControllerTest.php b/tests/Core/Controller/PreviewControllerTest.php index e7ecba27064db..2c2411e666fc4 100644 --- a/tests/Core/Controller/PreviewControllerTest.php +++ b/tests/Core/Controller/PreviewControllerTest.php @@ -265,7 +265,7 @@ public function testFileWithoutDownloadPermissionButHeader() { $this->request ->method('getHeader') - ->with('X-NC-Preview') + ->with('x-nc-preview') ->willReturn('true'); $preview = $this->createMock(ISimpleFile::class); diff --git a/vendor-bin/openapi-extractor/composer.lock b/vendor-bin/openapi-extractor/composer.lock index 3fb8ba7410661..da6e78295965a 100644 --- a/vendor-bin/openapi-extractor/composer.lock +++ b/vendor-bin/openapi-extractor/composer.lock @@ -81,16 +81,16 @@ }, { "name": "nextcloud/openapi-extractor", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/nextcloud-releases/openapi-extractor.git", - "reference": "50391ff00656b88a9ca0d934c386c3e20642f24a" + "reference": "4c7a66afce9938279473fc08cadf011de41150f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-releases/openapi-extractor/zipball/50391ff00656b88a9ca0d934c386c3e20642f24a", - "reference": "50391ff00656b88a9ca0d934c386c3e20642f24a", + "url": "https://api.github.com/repos/nextcloud-releases/openapi-extractor/zipball/4c7a66afce9938279473fc08cadf011de41150f8", + "reference": "4c7a66afce9938279473fc08cadf011de41150f8", "shasum": "" }, "require": { @@ -122,22 +122,22 @@ "description": "A tool for extracting OpenAPI specifications from Nextcloud source code", "support": { "issues": "https://github.com/nextcloud-releases/openapi-extractor/issues", - "source": "https://github.com/nextcloud-releases/openapi-extractor/tree/v1.7.0" + "source": "https://github.com/nextcloud-releases/openapi-extractor/tree/v1.8.0" }, - "time": "2025-05-15T08:30:31+00:00" + "time": "2025-06-03T13:01:15+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", "shasum": "" }, "require": { @@ -180,9 +180,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-05-31T08:24:38+00:00" }, { "name": "phpstan/phpdoc-parser",