4040use OCA \DocumentServer \XHRCommand \UnlockDocument ;
4141use OCA \DocumentServer \XHRCommand \OpenDocument ;
4242use OCP \AppFramework \Http \DataResponse ;
43+ use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
44+ use OCP \AppFramework \Http \Attribute \NoCSRFRequired ;
45+ use OCP \AppFramework \Http \Attribute \PublicPage ;
4346use OCP \IRequest ;
4447use OCP \IURLGenerator ;
4548use OCP \Security \ISecureRandom ;
@@ -115,20 +118,17 @@ protected function getIdleHandlerClasses(): array {
115118 return self ::IDLE_HANDLERS ;
116119 }
117120
118- /**
119- * @NoAdminRequired
120- * @NoCSRFRequired
121- * @PublicPage
122- */
121+ #[NoAdminRequired]
122+ #[NoCSRFRequired]
123+ #[PublicPage]
123124 public function healthCheck () {
124- return true ;
125+ return new DataResponse (true );
126+ //return true;
125127 }
126128
127- /**
128- * @NoAdminRequired
129- * @NoCSRFRequired
130- * @PublicPage
131- */
129+ #[NoAdminRequired]
130+ #[NoCSRFRequired]
131+ #[PublicPage]
132132 public function documentFile (int $ docId , string $ path , ?bool $ download ) {
133133 $ file = $ this ->documentStore ->openDocumentFile ($ docId , $ path );
134134
@@ -146,11 +146,9 @@ public function documentFile(int $docId, string $path, ?bool $download) {
146146 return $ response ;
147147 }
148148
149- /**
150- * @NoAdminRequired
151- * @NoCSRFRequired
152- * @PublicPage
153- */
149+ #[NoAdminRequired]
150+ #[NoCSRFRequired]
151+ #[PublicPage]
154152 public function upload (int $ docId , string $ index ) {
155153 $ content = fopen ('php://input ' , 'r ' );
156154 $ mime = $ this ->request ->getHeader ('Content-Type ' );
@@ -170,11 +168,9 @@ public function upload(int $docId, string $index) {
170168 ]);
171169 }
172170
173- /**
174- * @NoAdminRequired
175- * @NoCSRFRequired
176- * @PublicPage
177- */
171+ #[NoAdminRequired]
172+ #[NoCSRFRequired]
173+ #[PublicPage]
178174 public function download (int $ docId , string $ cmd ) {
179175 $ cmd = json_decode ($ cmd , true );
180176 $ content = fopen ('php://input ' , 'r ' );
0 commit comments