Skip to content

Commit

Permalink
Allow sdr#file_content routes to support file names with any characte…
Browse files Browse the repository at this point in the history
…rs, including dots
  • Loading branch information
cbeer committed Jan 18, 2017
1 parent 02395c3 commit dce5a5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .rubocop.yml
Expand Up @@ -40,3 +40,7 @@ Metrics/LineLength:

Metrics/BlockLength:
Enabled: false

RSpec/ExpectActual:
Exclude:
- 'spec/routing/**'
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -9,7 +9,7 @@
get 'current_version', to: 'sdr#current_version'
get 'manifest/:dsname', to: 'sdr#ds_manifest', format: false
get 'metadata/:dsname', to: 'sdr#ds_metadata', format: false
get 'content/:filename', to: 'sdr#file_content', format: false
get 'content/:filename', to: 'sdr#file_content', format: false, constraints: { filename: /.+/ }
end

scope '/workflows/:wf_name' do
Expand Down
10 changes: 10 additions & 0 deletions spec/routing/sdr_controller_spec.rb
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.describe SdrController, type: :routing do
describe 'routing' do
it 'routes to #content' do
expect(get: '/v1/sdr/objects/druid:mk420bs7601/content/00004692.tif')
.to route_to('sdr#file_content', druid: 'druid:mk420bs7601', filename: '00004692.tif')
end
end
end

0 comments on commit dce5a5f

Please sign in to comment.