tus-server 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tus/server.rb +6 -3
- data/tus-server.gemspec +1 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36bbbd4c6dbe035aa29381c81d8f768c0cf77e22
|
4
|
+
data.tar.gz: 57754ffdcfd6af35246665a8e64f72a04b7bdbbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1568916bb3051ce1dc9bded384142c52e59659b25638e75786ff671dd2897c50f7c92cb0423d7dc2fee972155b6e6b419381a430f27e79f46cae5bd670199d7f
|
7
|
+
data.tar.gz: 02ce9bc6b19489fae9630a2ab49a74118fd6079d9906eb22c7e82972c9610e9043a8620be8ddd57a7beb33623d013946e47becf112cfb0a2b42807d42120376e
|
data/lib/tus/server.rb
CHANGED
@@ -161,6 +161,7 @@ module Tus
|
|
161
161
|
response.headers["Content-Disposition"] = opts[:disposition]
|
162
162
|
response.headers["Content-Disposition"] += "; filename=\"#{metadata["filename"]}\"" if metadata["filename"]
|
163
163
|
response.headers["Content-Type"] = metadata["content_type"] || "application/octet-stream"
|
164
|
+
response.headers
|
164
165
|
|
165
166
|
response = storage.get_file(uid, info.to_h, range: range)
|
166
167
|
|
@@ -298,6 +299,9 @@ module Tus
|
|
298
299
|
|
299
300
|
# "Range" header handling logic copied from Rack::File
|
300
301
|
def handle_range_request!(length)
|
302
|
+
# we support ranged requests
|
303
|
+
response.headers["Accept-Ranges"] = "bytes"
|
304
|
+
|
301
305
|
if Rack.release >= "2.0"
|
302
306
|
ranges = Rack::Utils.get_byte_ranges(request.headers["Range"], length)
|
303
307
|
else
|
@@ -305,15 +309,14 @@ module Tus
|
|
305
309
|
end
|
306
310
|
|
307
311
|
if ranges.nil? || ranges.length > 1
|
308
|
-
#
|
312
|
+
# no ranges, or multiple ranges (which we don't support)
|
309
313
|
response.status = 200
|
310
314
|
range = 0..length-1
|
311
315
|
elsif ranges.empty?
|
312
|
-
#
|
316
|
+
# unsatisfiable range
|
313
317
|
response.headers["Content-Range"] = "bytes */#{length}"
|
314
318
|
error!(416, "Byte range unsatisfiable")
|
315
319
|
else
|
316
|
-
# Partial content:
|
317
320
|
range = ranges[0]
|
318
321
|
response.status = 206
|
319
322
|
response.headers["Content-Range"] = "bytes #{range.begin}-#{range.end}/#{length}"
|
data/tus-server.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = "tus-server"
|
3
|
-
gem.version = "1.1.
|
3
|
+
gem.version = "1.1.3"
|
4
4
|
|
5
5
|
gem.required_ruby_version = ">= 2.1"
|
6
6
|
|
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_development_dependency "minitest", "~> 5.8"
|
21
21
|
gem.add_development_dependency "rack-test_app"
|
22
22
|
gem.add_development_dependency "cucumber"
|
23
|
-
gem.add_development_dependency "unicorn"
|
24
23
|
gem.add_development_dependency "mongo"
|
25
24
|
gem.add_development_dependency "aws-sdk-s3", "~> 1.2"
|
26
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tus-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roda
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: unicorn
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: mongo
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|