Closed mrsweaters closed 5 years ago
What's interesting is that if I log r.body.string
in app.rb right about line 36 I get the correct params payload:
{"filename":"SampleVideo_1280x720_1mb.mp4","type":"video/mp4"}
But as soon as I call r.params
it fails silently.
Logging r.env.
shows that the correctly content type of application/json
has been set.
Fails on this line in Roda: https://github.com/jeremyevans/roda/blob/master/lib/roda/plugins/json_parser.rb#L81
It's odd, looks like you are using the standard parser. When I call JSON.parse
directly on r.env['rack.input'].read
it works.
I figured it out! I had the Oj gem installed and it was conflicting with Roda.
Had this in my Oj initializer:
require 'oj'
Oj.default_options = { mode: :compat, symbol_keys: true, use_to_json: true }
Oj.mimic_JSON()
Oj.add_to_json(
Array, BigDecimal, Complex, Date, DateTime,
Exception, Hash, Integer, OpenStruct, Range,
Rational, Regexp, Struct, Time
)
Removing Oj solved the problem.
I'm seeing an odd issue where the post request to /s3/multipart is failing on this line: https://github.com/janko/uppy-s3_multipart/blob/master/lib/uppy/s3_multipart/app.rb#L36
It looks like a call to
r.params
is failing.Integration
I'm posting through a webpack-dev-server proxy in development. Front end route is
/api/s3/multipart
which routes to/s3/mulipart
on the backend. If I throw a log in the ther.post
block in s3_multipart/app.rb I see that the request is making through the proxy. Not sure why it is failing onr.params
.