Skip to content

Parameters provided by multipart-middleware are overridden by coerce-request-middleware #734

@ferdinand-beyer

Description

@ferdinand-beyer

We use a middleware stack that uses both multipart-middleware and coerce-request-middleware, in that order.

We had the strange behaviour that a route that defines both :parameters :multipart and :parameters :path had :multipart-params in the request, but no :parameters :multipart.

After some digging, it turns out that multipart-middleware merges the coerced params into :parameters, but coerce-request-middleware assocs :parameters, overwriting existing data at that key. In our case: the :multipart part.

It seems like we would need to swap the order, and apply the multipart middleware after the coercion middleware.

Alternatively, we ended up using the plain Ring multipart middleware, and configure our coercion so that coerce-request-middleware also coerces :multipart-params.

This might be a documentation issue, or maybe coerce-request-middleware should also merge?

Metadata

Metadata

Assignees

Type

No type

Projects

Status

👍 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions