falcon 0.17.4 → 0.17.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/falcon/adapters/output.rb +9 -6
- data/lib/falcon/adapters/response.rb +1 -1
- data/lib/falcon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5236b4f598c705ca3edc34fde0642c631db40667e3eff10f86421803282e4e0f
|
4
|
+
data.tar.gz: 0b368e6e54a9ca811d29a514c007d653140f9f0a6440c7f71be17729a66dec7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703c41487454bec117de57d6bdf30f8492133ac1b8d589d430fcffb8d436e075f97f5749d5acb50179aad3a104292d54fc963c58c5b0c2b973634435804ed154
|
7
|
+
data.tar.gz: 9c0be50a44d5f9bc19a99cbf8aadb5a61324b30195ed3ada6f096e13e25513a5c3a64b6fc213ec51639da5b793a92d1265a9b8de705778614e98f363c286af31
|
data/README.md
CHANGED
@@ -36,6 +36,10 @@ Falcon supports `rack.hijack` for HTTP/1.x connections. You can thus use [async-
|
|
36
36
|
|
37
37
|
[async-websocket]: https://github.com/socketry/async-websocket
|
38
38
|
|
39
|
+
#### ActionCable
|
40
|
+
|
41
|
+
The `rack.hijack` functionality is compatible with ActionCable. If you use the `async` adapter, you should run falcon in threaded mode, or in forked mode with `--concurrency 1`. Otherwise, your messaging system will be distributed over several processes with no IPC mechanism.
|
42
|
+
|
39
43
|
### Integration with Guard
|
40
44
|
|
41
45
|
Falcon can restart very quickly and is ideal for use with guard. See [guard-falcon] for more details.
|
@@ -27,20 +27,23 @@ module Falcon
|
|
27
27
|
CONTENT_LENGTH = 'content-length'.freeze
|
28
28
|
|
29
29
|
# Wraps an array into a buffered body.
|
30
|
-
def self.wrap(headers, body)
|
30
|
+
def self.wrap(status, headers, body)
|
31
|
+
# In no circumstance do we want this propagating up:
|
32
|
+
content_length = headers.delete(CONTENT_LENGTH)
|
33
|
+
|
31
34
|
if body.is_a?(Async::HTTP::Body::Readable)
|
32
35
|
return body
|
33
|
-
|
34
|
-
|
36
|
+
elsif status == 200 and body.respond_to?(:to_path)
|
37
|
+
# Don't mangle partial responsese (206)
|
35
38
|
return Async::HTTP::Body::File.open(body.to_path)
|
36
39
|
else
|
37
|
-
return self.new(headers, body)
|
40
|
+
return self.new(headers, body, (Integer(content_length) rescue nil))
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
41
|
-
def initialize(headers, body)
|
44
|
+
def initialize(headers, body, length)
|
42
45
|
# We don't trust the user to provide the right length to the transport.
|
43
|
-
@length =
|
46
|
+
@length = length
|
44
47
|
|
45
48
|
@body = body
|
46
49
|
@chunks = body.to_enum(:each)
|
@@ -27,7 +27,7 @@ module Falcon
|
|
27
27
|
# We normalize headers to be lower case:
|
28
28
|
headers = headers.map{|key, value| [key.downcase, value]}.to_h
|
29
29
|
|
30
|
-
super(nil, status, nil, headers, Output.wrap(headers, body))
|
30
|
+
super(nil, status, nil, headers, Output.wrap(status, headers, body))
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|