You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a backtrace crash with a very simple example: I set a rest resource endpoint, and when I GET the endpoint without the trailing slash, it works. When I don't, it throws an error and gets unhandled. Here's part of the backtrace that might be relevant:
#<ArgumentError: wrong number of arguments (given 1, expected 0)>
/home/.bundle/ruby/2.3.0/gems/roda-rest_api-2.0.1/lib/roda/plugins/rest_api.rb:233:in `block in index'
/home/.bundle/ruby/2.3.0/gems/roda-2.20.0/lib/roda.rb:807:in `if_match'
/home/.bundle/ruby/2.3.0/gems/roda-2.20.0/lib/roda.rb:743:in `_verb'
/home/.bundle/ruby/2.3.0/gems/roda-2.20.0/lib/roda.rb:370:in `get'
/home/.bundle/ruby/2.3.0/gems/roda-rest_api-2.0.1/lib/roda/plugins/rest_api.rb:234:in `index'
/home/.bundle/ruby/2.3.0/gems/roda-rest_api-2.0.1/lib/roda/plugins/rest_api.rb:89:in `block in routes!'
With this example I demonstrate that the problem is not roda (I'm using 2.21), which correctly handles the trailing slash. You can also see that this gem uses the #get method to set the show/index, and roda doesn't handle trailing slashes with this. But even when that happens, roda doesn't crash (just 404's).
The text was updated successfully, but these errors were encountered:
I get a backtrace crash with a very simple example: I set a rest resource endpoint, and when I GET the endpoint without the trailing slash, it works. When I don't, it throws an error and gets unhandled. Here's part of the backtrace that might be relevant:
Here is a small route dec to reproduce the issue:
Now use curl and fetch the following URLs:
With this example I demonstrate that the problem is not roda (I'm using 2.21), which correctly handles the trailing slash. You can also see that this gem uses the
#get
method to set the show/index, and roda doesn't handle trailing slashes with this. But even when that happens, roda doesn't crash (just 404's).The text was updated successfully, but these errors were encountered: