riiif 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/riiif/images_controller.rb +5 -0
- data/lib/riiif/routes.rb +3 -1
- data/lib/riiif/version.rb +1 -1
- data/spec/routing/redirect_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6efe627c8447edf7fb8c3d84e80873ea6b982da8
|
4
|
+
data.tar.gz: e413435a4b26f0f780d9e44ba6c440f4c336ee04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9daf82eddde5d2a9f1d2902bf707ed93027e7864bcab5c600783fcd86b48f954c7b172b27e83e6ca28dfe04707ec83a043d6278f9b4d16c69b26dfb5b541395
|
7
|
+
data.tar.gz: dee840b52e762df8631121c3a55fe6ca3ec6d0bf51cfe9e6dd557810dd05b6c44695bb561da09836568a03431d155bf7055e1a4c0fda12d984a994da8d6049a4
|
@@ -32,6 +32,11 @@ module Riiif
|
|
32
32
|
render json: image.info.merge(server_info), content_type: 'application/ld+json'
|
33
33
|
end
|
34
34
|
|
35
|
+
# this is a workaround for https://github.com/rails/rails/issues/25087
|
36
|
+
def redirect
|
37
|
+
redirect_to info_path(params[:id])
|
38
|
+
end
|
39
|
+
|
35
40
|
protected
|
36
41
|
|
37
42
|
LEVEL1 = 'http://iiif.io/api/image/2/level1.json'
|
data/lib/riiif/routes.rb
CHANGED
@@ -24,7 +24,9 @@ module Riiif
|
|
24
24
|
|
25
25
|
get "#{route_prefix}/:id/info.json" => "riiif/images#info", defaults: { format: 'json', model: resource }, as: [options[:as], "info"].compact.join("_")
|
26
26
|
|
27
|
-
|
27
|
+
# This doesn't work presently
|
28
|
+
# get "#{route_prefix}/:id", to: redirect("#{route_prefix}/%{id}/info.json")
|
29
|
+
get "#{route_prefix}/:id" => 'riiif/images#redirect'
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/riiif/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe "
|
4
|
-
it "
|
5
|
-
get "/image-service/
|
6
|
-
expect(response).to redirect_to ('/image-service/
|
3
|
+
describe "GET /abcd%2F1234", type: :request do
|
4
|
+
it "redirects, without unescaping" do
|
5
|
+
get "/image-service/abcd%2F1234"
|
6
|
+
expect(response).to redirect_to ('/image-service/abcd%2F1234/info.json')
|
7
7
|
end
|
8
8
|
end
|