Skip to content

Commit b5b7528

Browse files
Move registration of JSON merge patch to js-service-api (#549)
This way it can respect the body limit.
2 parents bb031fc + 3e2715d commit b5b7528

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

acs-configdb/lib/routes.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/*
2-
* ACS ConfigDB
3-
* Express routing
4-
* Copyright 2024 University of Sheffield AMRC
2+
* Copyright (c) University of Sheffield AMRC 2025.
53
*/
64

75
import url from "url";
@@ -28,8 +26,6 @@ export function routes (opts) {
2826
/* No fancy query-string parsing */
2927
app.set("query parser", "simple");
3028

31-
app.use(express.json({ type: "application/merge-patch+json" }));
32-
3329
/* Serve the editor */
3430
const editor = url.fileURLToPath(new URL("../editor", import.meta.url));
3531
fplus.debug.log("editor", `Serving editor out of ${editor}.`);

lib/js-service-api/lib/webapi.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/*
2-
* Factory+ Service HTTP API
3-
* API framework class
4-
* Copyright 2024 University of Sheffield
2+
* Copyright (c) University of Sheffield AMRC 2025.
53
*/
64

75
import http from "http";
@@ -42,6 +40,7 @@ export class WebAPI {
4240
app.use(express.raw({ type: "*/*", limit: this.body_limit }));
4341
} else {
4442
app.use(express.json({ limit: this.body_limit, strict: false }));
43+
app.use(express.json({ limit: this.body_limit, strict: false, type: "application/merge-patch+json" }));
4544
}
4645

4746
/* Logging */

0 commit comments

Comments
 (0)