hydra-core 6.1.1 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6823b327eeb35861172d4fe2f92b00519d103d0b
|
4
|
+
data.tar.gz: 32142650a0e2b2117501ddaa661c365af11c76b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4badc4b07b639c500d8176c2c0e79bf2dbd840330c3122767636d8290c7d5c29a322cc2332d1c9e5f53f46b87ac4996405e9cdc689d5e19f4d1924f84cd92fd8
|
7
|
+
data.tar.gz: 20ec96f1b7fc208e67cb5dfafd793b2faca66f383fcf1854f15594855ad9e0a5f587111598d8b78e4fd8ddb36196b17ad82c4d374fc404f464bb9237809f5397
|
data/lib/hydra-head/version.rb
CHANGED
@@ -62,9 +62,9 @@ module Hydra
|
|
62
62
|
response.headers['Accept-Ranges'] = 'bytes'
|
63
63
|
|
64
64
|
if request.head?
|
65
|
-
content_head
|
65
|
+
content_head
|
66
66
|
elsif request.headers["Range"]
|
67
|
-
send_range
|
67
|
+
send_range
|
68
68
|
else
|
69
69
|
send_file_headers! content_options
|
70
70
|
self.response_body = datastream.stream
|
@@ -72,6 +72,61 @@ describe DownloadsController do
|
|
72
72
|
response.body.should == 'foobarfoobarfoobar'
|
73
73
|
end
|
74
74
|
end
|
75
|
+
describe "stream" do
|
76
|
+
before do
|
77
|
+
stub_response = stub()
|
78
|
+
stub_response.stub(:read_body).and_yield("one1").and_yield('two2').and_yield('thre').and_yield('four')
|
79
|
+
stub_repo = stub()
|
80
|
+
stub_repo.stub(:datastream_dissemination).and_yield(stub_response)
|
81
|
+
stub_ds = ActiveFedora::Datastream.new
|
82
|
+
stub_ds.stub(:repository).and_return(stub_repo)
|
83
|
+
stub_ds.stub(:mimeType).and_return('video/webm')
|
84
|
+
stub_ds.stub(:dsSize).and_return(16)
|
85
|
+
stub_ds.stub(:dsid).and_return('webm')
|
86
|
+
stub_ds.stub(:pid).and_return('changeme:test')
|
87
|
+
stub_file = stub('stub object', datastreams: {'webm' => stub_ds}, pid:'changeme:test', label: "MyVideo.webm")
|
88
|
+
ActiveFedora::Base.should_receive(:load_instance_from_solr).with('changeme:test').and_return(stub_file)
|
89
|
+
controller.stub(:can?).with(:read, 'changeme:test').and_return(true)
|
90
|
+
controller.stub(:log_download)
|
91
|
+
end
|
92
|
+
it "head request" do
|
93
|
+
request.env["Range"] = 'bytes=0-15'
|
94
|
+
head :show, id: 'changeme:test', datastream_id: 'webm'
|
95
|
+
response.headers['Content-Length'].should == 16
|
96
|
+
response.headers['Accept-Ranges'].should == 'bytes'
|
97
|
+
response.headers['Content-Type'].should == 'video/webm'
|
98
|
+
end
|
99
|
+
it "should send the whole thing" do
|
100
|
+
request.env["Range"] = 'bytes=0-15'
|
101
|
+
get :show, id: 'changeme:test', datastream_id: 'webm'
|
102
|
+
response.body.should == 'one1two2threfour'
|
103
|
+
response.headers["Content-Range"].should == 'bytes 0-15/16'
|
104
|
+
response.headers["Content-Length"].should == '16'
|
105
|
+
response.headers['Accept-Ranges'].should == 'bytes'
|
106
|
+
response.headers['Content-Type'].should == "video/webm"
|
107
|
+
response.headers["Content-Disposition"].should == "inline; filename=\"MyVideo.webm\""
|
108
|
+
response.status.should == 206
|
109
|
+
end
|
110
|
+
it "should send the whole thing when the range is open ended" do
|
111
|
+
request.env["Range"] = 'bytes=0-'
|
112
|
+
get :show, id: 'changeme:test', datastream_id: 'webm'
|
113
|
+
response.body.should == 'one1two2threfour'
|
114
|
+
end
|
115
|
+
it "should get a range not starting at the beginning" do
|
116
|
+
request.env["Range"] = 'bytes=3-15'
|
117
|
+
get :show, id: 'changeme:test', datastream_id: 'webm'
|
118
|
+
response.body.should == '1two2threfour'
|
119
|
+
response.headers["Content-Range"].should == 'bytes 3-15/16'
|
120
|
+
response.headers["Content-Length"].should == '13'
|
121
|
+
end
|
122
|
+
it "should get a range not ending at the end" do
|
123
|
+
request.env["Range"] = 'bytes=4-11'
|
124
|
+
get :show, id: 'changeme:test', datastream_id: 'webm'
|
125
|
+
response.body.should == 'two2thre'
|
126
|
+
response.headers["Content-Range"].should == 'bytes 4-11/16'
|
127
|
+
response.headers["Content-Length"].should == '8'
|
128
|
+
end
|
129
|
+
end
|
75
130
|
end
|
76
131
|
|
77
132
|
describe "when not logged in as reader" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield,
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 6.
|
90
|
+
version: 6.2.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 6.
|
97
|
+
version: 6.2.0
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: jettywrapper
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -195,7 +195,6 @@ files:
|
|
195
195
|
- lib/generators/hydra/templates/config/fedora.yml
|
196
196
|
- lib/generators/hydra/templates/config/initializers/action_dispatch_http_upload_monkey_patch.rb
|
197
197
|
- lib/generators/hydra/templates/config/initializers/hydra_config.rb
|
198
|
-
- lib/generators/hydra/templates/config/jetty.yml
|
199
198
|
- lib/generators/hydra/templates/config/role_map_cucumber.yml
|
200
199
|
- lib/generators/hydra/templates/config/role_map_development.yml
|
201
200
|
- lib/generators/hydra/templates/config/role_map_production.yml
|