File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def self.instance
2020
2121 # rewrite HAL links to make them clickable in a browser
2222 use Rack ::Rewrite do
23- r302 %r{^(\/ api \/ \w * \/ )(%7B|\{ )?(.*)(%7D|\} )$} , '$1'
23+ r302 %r{^([ \/ \w ]* )(%7B|\{ )?(.*)(%7D|\} )$} , '$1'
2424 end
2525
2626 run Acme ::App . new
Original file line number Diff line number Diff line change @@ -30,4 +30,9 @@ def app
3030 expect ( last_response . status ) . to eq 302
3131 expect ( last_response . headers [ 'Location' ] ) . to eq '/api/splines/'
3232 end
33+ it 'rewrites encoded HAL links without a trailing slash to make them clickable' do
34+ get '/api/splines%7B?cursor,size%7D'
35+ expect ( last_response . status ) . to eq 302
36+ expect ( last_response . headers [ 'Location' ] ) . to eq '/api/splines'
37+ end
3338end
You can’t perform that action at this time.
0 commit comments