Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Exception ArgumentError in Rack application object (invalid %-encoding) #21
When this Harmonia task was first assigned, it looks as if the following exception occurred:
I've confirmed the above by re-assigning the task in Harmonia. I saw the following output in
I've just reproduced this exception using a new action:
post '/percent' do json = request.body.read attributes = JSON.parse(json) [200, attributes.inspect] end
And sending the following POST request:
I then noticed this related issue and discovered that setting a content-type header to JSON avoided the exception being raised:
In fact it turns out that setting the content type to
I think my conclusion is that Harmonia probably isn't setting a content-type header, but ought to be.
Having said that, I think we can reasonably assume that all requests to this app are currently expected to have a JSON content-type, so I'm going to investigate adding some custom middleware to inject this header as suggested in this comment.