Skip to content

Commit

Permalink
add comment describing the need for the formData middleware (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen authored Aug 8, 2024
1 parent e0adec7 commit 980bff9
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 980bff9

Please sign in to comment.