From 081d75c98429e9dd8c88f363f23d080dd96e067b Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Wed, 7 Aug 2024 14:18:06 -0400 Subject: [PATCH] add comment describing the need for the formData middleware --- src/http-api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/http-api.ts b/src/http-api.ts index 7629237..8d2fce3 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -84,7 +84,10 @@ export class HttpApi { #setupMiddleware(): void { this.#api.use(cors({ exposedHeaders: 'dwn-response' })); this.#api.use(express.json()); - this.#api.use(express.urlencoded({ extended: true })); // formdata middleware + + // We enable the formData middleware to handle multipart/form-data requests. + // This is necessary for the endpoints used by the Web5 Connect Server/OIDC flow. + this.#api.use(express.urlencoded({ extended: true })); this.#api.use( responseTime((req: Request, res: Response, time) => { const url = req.url === '/' ? '/jsonrpc' : req.url;