X Tutup
Skip to content

Commit d19eb4b

Browse files
DeepDiver1975JammingBen
authored andcommitted
fix: this allows to implement OPTIONS request handling in framework c… (#38758)
* fix: this allows to implement OPTIONS request handling in framework controllers - if it is not a CORS preflight request. CORS requests will continue to be handled by core * Add changelog item for #38758 Co-authored-by: Jannik Stehle <jannik.stehle@gmail.com>
1 parent cd1bce4 commit d19eb4b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog/unreleased/38758

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Enhancement: Allow OPTIONS request handling in framework controllers
2+
3+
https://github.com/owncloud/core/pull/38758

lib/private/Route/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function match($url) {
282282

283283
$matcher = new UrlMatcher($this->root, $this->context);
284284

285-
if (\OC::$server->getRequest()->getMethod() === "OPTIONS") {
285+
if (\OC::$server->getRequest()->getMethod() === "OPTIONS" && \OC::$server->getRequest()->getHeader('Access-Control-Request-Method')) {
286286
try {
287287
// Checking whether the actual request (one which OPTIONS is pre-flight for)
288288
// Is actually valid

0 commit comments

Comments
 (0)
X Tutup