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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tus/server.rb +6 -3
  3. data/tus-server.gemspec +1 -2
  4. metadata +2 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75d994c5e03d4027f723c3bb32dc17589e1fe6bc
4
- data.tar.gz: 300bcd61d11c05963fea1d6e02f4684b35a3a8e7
3
+ metadata.gz: 36bbbd4c6dbe035aa29381c81d8f768c0cf77e22
4
+ data.tar.gz: 57754ffdcfd6af35246665a8e64f72a04b7bdbbd
5
5
  SHA512:
6
- metadata.gz: f3e9d86ff10b063367dda70bd44bc38d8f56485fabfaa209f7f341ebd7c87b7cd3f0cf4e40855e142577c0e40cde763effe349fc54ed8bc2e7c93046eac566cb
7
- data.tar.gz: 63e466d8dc751465871cd74d951357fc3918cb8ef0a60a35124dd88b452141be1a4c5e057c7a3944208ca4e039c76f555df86e319f63a75aeb188e6df65a5986
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
- # No ranges, or multiple ranges (which we don't support):
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
- # Unsatisfiable. Return error, and file size:
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.2"
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.2
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-12 00:00:00.000000000 Z
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