Skip to content

Commit 2f1e302

Browse files
authored
Add OCS-APIRequest to list of allowed CORS headers
Adding the `OCS-APIRequest` header to the list of allowed headers This makes the OCS API usable by external web apps via XMLHttpRequest: Otherwise the access to the resource is either blocked by the OCS API (missing `OCS-APIRequest: true` header) or by the browser (`OCS-APIRequest: true` header not allowed by CORS).
1 parent c9ea236 commit 2f1e302

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/public/AppFramework/OCSController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ abstract class OCSController extends ApiController {
6161
public function __construct($appName,
6262
IRequest $request,
6363
$corsMethods = 'PUT, POST, GET, DELETE, PATCH',
64-
$corsAllowedHeaders = 'Authorization, Content-Type, Accept',
64+
$corsAllowedHeaders = 'Authorization, Content-Type, Accept, OCS-APIRequest',
6565
$corsMaxAge = 1728000) {
6666
parent::__construct($appName, $request, $corsMethods,
6767
$corsAllowedHeaders, $corsMaxAge);

0 commit comments

Comments
 (0)