Skip to content

Commit

Permalink
add comment describing the need for the formData middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Aug 7, 2024
1 parent e0adec7 commit 081d75c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/http-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 081d75c

Please sign in to comment.