Skip to content

Commit

Permalink
Register mime type before app initialization
Browse files Browse the repository at this point in the history
- Register mime type before app initialization
- Skip the app initialization for dav requests

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Dec 8, 2019
1 parent 8411f39 commit e0ee3d9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions keeweb/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
use OCP\AppFramework\App;
use OCA\Keeweb\Controller\PageController;

$mimeTypeDetector = \OC::$server->getMimeTypeDetector();
$mimeTypeDetector->registerType('kdbx', 'application/x-kdbx', 'application/x-kdbx');

if (\OC::$REQUESTEDAPP === 'dav') {
/** For dav requests it should be enough to register the mime type and skip the rest of the app initialization. */
return;
}

require_once __DIR__ . '/autoload.php';

class Application extends App {
Expand Down Expand Up @@ -58,9 +66,6 @@ public function __construct(array $urlParams=array()){
];
});

$mimeTypeDetector = \OC::$server->getMimeTypeDetector();
$mimeTypeDetector->registerType('kdbx', 'application/x-kdbx', 'application/x-kdbx');

// Script for registering file actions
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
Expand Down

0 comments on commit e0ee3d9

Please sign in to comment.