tus-server 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/tus/server.rb +5 -2
- data/tus-server.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f187175b5569bccd517340434f973d7e96f132ba
|
4
|
+
data.tar.gz: 0ff7f0123216ce0dbdb2489b6adcebf3926c5c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dd9f5915eb84b1a1ac82bffa71b5d928dcba9663e2af9cc296643fd22bd378fa09d211df0e3099c339bab7e4da64503d36c3b6b4e6041bf990edd5991691591
|
7
|
+
data.tar.gz: f7fba129bb83e2e2ff8d526bd31581192952f7b86690809c4f1c011df7d31d20b618a088831c7d0e777e86c5c4ce031b652146c3bf54c7a13091a1524e32af20
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -308,8 +308,8 @@ storage into the response body.
|
|
308
308
|
The endpoint will automatically use the following `Upload-Metadata` values if
|
309
309
|
they're available:
|
310
310
|
|
311
|
-
* `
|
312
|
-
* `
|
311
|
+
* `type` -- used in the `Content-Type` response header
|
312
|
+
* `name` -- used in the `Content-Disposition` response header
|
313
313
|
|
314
314
|
The `Content-Disposition` header will be set to "inline" by default, but you
|
315
315
|
can change it to "attachment" if you want the browser to always force download:
|
data/lib/tus/server.rb
CHANGED
@@ -162,9 +162,12 @@ module Tus
|
|
162
162
|
response.headers["Content-Length"] = (range.end - range.begin + 1).to_s
|
163
163
|
|
164
164
|
metadata = info.metadata
|
165
|
+
name = metadata["name"] || metadata["filename"]
|
166
|
+
type = metadata["type"] || metadata["content_type"]
|
167
|
+
|
165
168
|
response.headers["Content-Disposition"] = opts[:disposition]
|
166
|
-
response.headers["Content-Disposition"] += "; filename=\"#{
|
167
|
-
response.headers["Content-Type"] =
|
169
|
+
response.headers["Content-Disposition"] += "; filename=\"#{name}\"" if name
|
170
|
+
response.headers["Content-Type"] = type || "application/octet-stream"
|
168
171
|
response.headers
|
169
172
|
|
170
173
|
body = storage.get_file(uid, info.to_h, range: range)
|
data/tus-server.gemspec
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.2
|
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-
|
11
|
+
date: 2017-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roda
|