summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-07-11 11:10:26 -0700
committerGitHub <noreply@github.com>2022-07-11 11:10:26 -0700
commit57ae32e3c39969f585c23fb047f49a0f7bfac1cc (patch)
treecc16fbb864b585bf531f82561dd23cd67cb40639
parent16b5e6bc7f78f796eb7d8a4e1bd70cdc838dc119 (diff)
parent222a9523b518940e3011d70a78884fc24d42eb18 (diff)
downloadnextcloud-server-57ae32e3c39969f585c23fb047f49a0f7bfac1cc.tar.gz
nextcloud-server-57ae32e3c39969f585c23fb047f49a0f7bfac1cc.zip
Merge pull request #33175 from nextcloud/fix/request-json-xml-not-found
-rw-r--r--lib/base.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 814f30b5af3..26ad684a81a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -1048,6 +1048,13 @@ class OC {
return;
}
+ // Handle requests for JSON or XML
+ $acceptHeader = $request->getHeader('Accept');
+ if (in_array($acceptHeader, ['application/json', 'application/xml'], true)) {
+ http_response_code(404);
+ return;
+ }
+
// Someone is logged in
if (\OC::$server->getUserSession()->isLoggedIn()) {
OC_App::loadApps();