File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ export class ApiHandler<C extends Context> extends Handler<C> {
190190 if ( ! [ 'get' , 'post' ] . includes ( this . request . method . toLowerCase ( ) ) ) {
191191 throw new MethodNotAllowedError ( this . request . method ) ;
192192 }
193- if ( ! APIS [ op ] ) throw new BadRequestError ( ' Invalid operation' ) ;
193+ if ( ! APIS [ op ] ) throw new BadRequestError ( ` Invalid API operation: ${ op } ` ) ;
194194 if ( APIS [ op ] . type === 'Subscription' ) {
195195 throw new BadRequestError ( 'Subscription operation cannot be called in HTTP handler' ) ;
196196 }
@@ -226,7 +226,7 @@ export class ApiConnectionHandler<C extends Context> extends ConnectionHandler<C
226226 this . isRpc = true ;
227227 return ;
228228 }
229- if ( ! APIS [ op ] ) throw new BadRequestError ( ' Invalid operation' ) ;
229+ if ( ! APIS [ op ] ) throw new BadRequestError ( ` Invalid API operation: ${ op } ` ) ;
230230 if ( APIS [ op ] . type !== 'Subscription' ) {
231231 throw new BadRequestError ( 'Only subscription operations are supported' ) ;
232232 }
@@ -250,7 +250,7 @@ export class ApiConnectionHandler<C extends Context> extends ConnectionHandler<C
250250 throw new BadRequestError ( 'Invalid message' ) ;
251251 }
252252 }
253- if ( ! APIS [ message . op ] ) throw new BadRequestError ( ' Invalid operation' ) ;
253+ if ( ! APIS [ message . op ] ) throw new BadRequestError ( ` Invalid API operation: ${ message . op } ` ) ;
254254 if ( APIS [ message . op ] . type !== 'Subscription' ) {
255255 throw new BadRequestError ( 'Only subscription operations are supported' ) ;
256256 }
Original file line number Diff line number Diff line change 11{
22 "name" : " @hydrooj/framework" ,
3- "version" : " 0.2.4 " ,
3+ "version" : " 0.2.5 " ,
44 "main" : " index.ts" ,
55 "license" : " MIT" ,
66 "repository" : " https://github.com/hydro-dev/Hydro" ,
1313 "@mongodb-js/saslprep" : " ^1.3.2" ,
1414 "emoji-regex" : " ^10.6.0" ,
1515 "fs-extra" : " ^11.3.2" ,
16- "koa" : " ^3.0.3 " ,
16+ "koa" : " ^3.1.1 " ,
1717 "koa-body" : " ^7.0.0" ,
1818 "koa-compress" : " ^5.1.1" ,
1919 "path-to-regexp" : " ^8.3.0" ,
Original file line number Diff line number Diff line change @@ -412,6 +412,8 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
412412 formLimit : '8mb' ,
413413 formidable : {
414414 uploadDir,
415+ allowEmptyFiles : true ,
416+ minFileSize : 0 ,
415417 maxFileSize : parseMemoryMB ( this . config . upload ) * 1024 * 1024 ,
416418 keepExtensions : true ,
417419 } ,
You can’t perform that action at this time.
0 commit comments