How do you set up a file upload route correctly for a JSON-REST API?

Thanks @timriley!
The output for the upload-endpoint is:

>>> content_type: "multipart/form-data; boundary=------------------------l66OQWe0cxN8bD2hp6nkC9"
>>> config.formats.values: [:multipart]
>>> config.formats.mapping: {"application/octet-stream" => :all, "*/*" => :all, "multipart/form-data" => :multipart}
>>> accepted_mime_types(config): ["multipart/form-data"]

So the issue lies here:

Here’s the debug output:

>>> v1: "multipart" v2: "form-data; boundary=------------------------NYJ4v948lVEtMlrLscIhv8"
>>> m1: "multipart" m2: "form-data"

The m2-v2-match fails.

@timriley: What do you think? I think we should fix this at Rack? I opened an issue there: