falcon 0.18.5 → 0.18.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +5 -3
- data/lib/falcon/adapters/output.rb +5 -3
- data/lib/falcon/hosts.rb +10 -4
- data/lib/falcon/version.rb +1 -1
- data/server.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: 847f8d20937ff532517ca21f1564054cd79f340a0aee13f88798c048d5361b63
|
4
|
+
data.tar.gz: 252a0cc3cee3c1cf56646cff4bc9d458dd3308bcc6540eb30a7aa57e9bc92f21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f8f7ca9d48f240c536bdfe789528ff93b0e73cf2563f65975e62ae26a0fd27af4332271b5422ab53708a2fbaff667636998a8e1abd14e9905f66c2a9830e524
|
7
|
+
data.tar.gz: 29ab0345ce17eac91f5523de36429f0b3aba5b096f675152e688e232cc43331472b86091731a5efd73762f15381575a69429eaf04e0fe5d291e404494694abaa
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -45,9 +45,11 @@ You can run `falcon serve` directly, and it will load the `config.ru` and start
|
|
45
45
|
|
46
46
|
Falcon works perfectly with `rails` apps.
|
47
47
|
|
48
|
-
Add `gem 'falcon'` to your `Gemfile` and perhaps remove `gem 'puma'` once you are
|
48
|
+
1. Add `gem 'falcon'` to your `Gemfile` and perhaps remove `gem 'puma'` once you are satisfied with the change.
|
49
49
|
|
50
|
-
Run `
|
50
|
+
2. Run `falcon serve` to start a local development server.
|
51
|
+
|
52
|
+
Alternatively run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#181](https://github.com/rack/rack/pull/1181) is merged).
|
51
53
|
|
52
54
|
### WebSockets
|
53
55
|
|
@@ -81,7 +83,7 @@ This will run a single-threaded instance of Falcon.
|
|
81
83
|
|
82
84
|
## Performance
|
83
85
|
|
84
|
-
Falcon
|
86
|
+
Falcon uses an asynchronous event-driven reactor to provide non-blocking IO. It can handle an arbitrary number of in-flight requests with minimal overhead per request.
|
85
87
|
|
86
88
|
It uses one Fiber per request, which yields in the presence of blocking IO.
|
87
89
|
|
@@ -28,8 +28,10 @@ module Falcon
|
|
28
28
|
|
29
29
|
# Wraps an array into a buffered body.
|
30
30
|
def self.wrap(status, headers, body)
|
31
|
-
# In no circumstance do we want this propagating
|
32
|
-
content_length = headers.delete(CONTENT_LENGTH)
|
31
|
+
# In no circumstance do we want this header propagating out:
|
32
|
+
if content_length = headers.delete(CONTENT_LENGTH)
|
33
|
+
content_length = Integer(content_length)
|
34
|
+
end
|
33
35
|
|
34
36
|
if body.is_a?(Async::HTTP::Body::Readable)
|
35
37
|
return body
|
@@ -37,7 +39,7 @@ module Falcon
|
|
37
39
|
# Don't mangle partial responsese (206)
|
38
40
|
return Async::HTTP::Body::File.open(body.to_path)
|
39
41
|
else
|
40
|
-
return self.new(headers, body,
|
42
|
+
return self.new(headers, body, content_length)
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
data/lib/falcon/hosts.rb
CHANGED
@@ -25,6 +25,7 @@ module Falcon
|
|
25
25
|
def initialize
|
26
26
|
@app = nil
|
27
27
|
@endpoint = nil
|
28
|
+
|
28
29
|
@ssl_certificate = nil
|
29
30
|
@ssl_key = nil
|
30
31
|
|
@@ -37,6 +38,7 @@ module Falcon
|
|
37
38
|
|
38
39
|
attr_accessor :ssl_certificate
|
39
40
|
attr_accessor :ssl_key
|
41
|
+
|
40
42
|
attr_accessor :ssl_context
|
41
43
|
|
42
44
|
def freeze
|
@@ -56,7 +58,7 @@ module Falcon
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def ssl_context
|
59
|
-
@ssl_context ||= OpenSSL::SSL::SSLContext.new
|
61
|
+
@ssl_context ||= OpenSSL::SSL::SSLContext.new.tap do |context|
|
60
62
|
context.cert = @ssl_certificate
|
61
63
|
context.key = @ssl_key
|
62
64
|
|
@@ -64,7 +66,7 @@ module Falcon
|
|
64
66
|
|
65
67
|
context.set_params
|
66
68
|
|
67
|
-
context.
|
69
|
+
context.setup
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -101,7 +103,7 @@ module Falcon
|
|
101
103
|
end
|
102
104
|
|
103
105
|
def ssl_context
|
104
|
-
@server_context ||= OpenSSL::SSL::SSLContext.new
|
106
|
+
@server_context ||= OpenSSL::SSL::SSLContext.new.tap do |context|
|
105
107
|
context.servername_cb = Proc.new do |socket, hostname|
|
106
108
|
self.host_context(socket, hostname)
|
107
109
|
end
|
@@ -112,7 +114,7 @@ module Falcon
|
|
112
114
|
|
113
115
|
context.set_params
|
114
116
|
|
115
|
-
context.
|
117
|
+
context.setup
|
116
118
|
end
|
117
119
|
end
|
118
120
|
|
@@ -137,5 +139,9 @@ module Falcon
|
|
137
139
|
@named.collect{|name, host| [name, host.endpoint]}
|
138
140
|
]
|
139
141
|
end
|
142
|
+
|
143
|
+
def proxy
|
144
|
+
Proxy.new(Falcon::BadRequest, self.client_endpoints)
|
145
|
+
end
|
140
146
|
end
|
141
147
|
end
|
data/lib/falcon/version.rb
CHANGED
data/server.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.18.
|
4
|
+
version: 0.18.6
|
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-08-
|
11
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|