spooder 4.4.6 → 4.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/api.ts +3 -3
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -400,7 +400,7 @@ export async function db_init_schema_mysql(db_info: mysql_types.ConnectionOption
|
|
|
400
400
|
return await _db_init_schema_mysql(db_info, schema_dir, false) as mysql_types.Connection;
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
type CookieOptions = {
|
|
403
|
+
export type CookieOptions = {
|
|
404
404
|
same_site?: 'Strict' | 'Lax' | 'None',
|
|
405
405
|
secure?: boolean,
|
|
406
406
|
http_only?: boolean,
|
|
@@ -547,7 +547,7 @@ function route_directory(route_path: string, dir: string, handler: DirHandler):
|
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
-
export function validate_req_json(
|
|
550
|
+
export function validate_req_json(json_handler: JSONRequestHandler): RequestHandler {
|
|
551
551
|
return async (req: Request, url: URL) => {
|
|
552
552
|
try {
|
|
553
553
|
// validate content type header
|
|
@@ -560,7 +560,7 @@ export function validate_req_json(JSONRequestHandler: JSONRequestHandler): Reque
|
|
|
560
560
|
if (json === null || typeof json !== 'object' || Array.isArray(json))
|
|
561
561
|
return 400; // Bad Request
|
|
562
562
|
|
|
563
|
-
return
|
|
563
|
+
return json_handler(req, url, json);
|
|
564
564
|
} catch (e) {
|
|
565
565
|
return 400; // Bad Request
|
|
566
566
|
}
|