falcon 0.33.8 → 0.33.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/examples/csv/config.ru +30 -0
- data/lib/falcon/proxy.rb +7 -6
- data/lib/falcon/redirection.rb +1 -1
- data/lib/falcon/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82761b4748e08452384513f26cc7e90654ce7b0eee3c3a5a3bbabfe66cada520
|
4
|
+
data.tar.gz: 8aa7cd71bb13257e7f6021b7502911a48a14c0cc57f75fb4f6f0f57c89d23a9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d163c8357756514ba8ec30c6e4890970c588eb46a3141dc3dbc70a55944101a26abf770f6a27502632f64613c7b15fb68e05024f581a34865721316f2beb9d
|
7
|
+
data.tar.gz: ea88ab067f464aafe4420167d5d529131ba605d6c073435867fc11e4f27fd4f48eb74f62f44e2a3dc84da29178b20bba36ff3dd4421f04da0bda9b825b475b8b
|
data/README.md
CHANGED
@@ -126,7 +126,7 @@ Falcon works perfectly with `rails` apps.
|
|
126
126
|
|
127
127
|
2. Run `falcon serve` to start a local development server.
|
128
128
|
|
129
|
-
Alternatively run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#
|
129
|
+
Alternatively run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#1181](https://github.com/rack/rack/pull/1181) is merged).
|
130
130
|
|
131
131
|
#### Thread Safety
|
132
132
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env falcon --verbose serve -c
|
2
|
+
|
3
|
+
class MyApp
|
4
|
+
def initialize(app)
|
5
|
+
@app = app
|
6
|
+
|
7
|
+
@words = File.readlines('/usr/share/dict/words', chomp: true).each_slice(3).to_a
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(env)
|
11
|
+
body = Async::HTTP::Body::Writable.new(queue: Async::LimitedQueue.new(8))
|
12
|
+
|
13
|
+
Async do |task|
|
14
|
+
@words.each do |words|
|
15
|
+
Async.logger.debug("Sending #{words.inspect}")
|
16
|
+
body.write(words.join(",") + "\n")
|
17
|
+
task.sleep(1)
|
18
|
+
end
|
19
|
+
ensure
|
20
|
+
body.close($!)
|
21
|
+
end
|
22
|
+
|
23
|
+
return [200, [], body]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Build the middleware stack:
|
28
|
+
use MyApp
|
29
|
+
|
30
|
+
run lambda {|env| [404, {}, []]}
|
data/lib/falcon/proxy.rb
CHANGED
@@ -74,7 +74,7 @@ module Falcon
|
|
74
74
|
|
75
75
|
def lookup(request)
|
76
76
|
# Trailing dot and port is ignored/normalized.
|
77
|
-
if authority = request.authority
|
77
|
+
if authority = request.authority&.sub(/(\.)?(:\d+)?$/, '')
|
78
78
|
return @hosts[authority]
|
79
79
|
end
|
80
80
|
end
|
@@ -90,11 +90,12 @@ module Falcon
|
|
90
90
|
def prepare_request(request, host)
|
91
91
|
forwarded = []
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
Async.logger.debug(self) do |buffer|
|
94
|
+
buffer.puts "Request authority: #{request.authority}"
|
95
|
+
buffer.puts "Host authority: #{host.authority}"
|
96
|
+
buffer.puts "Endpoint authority: #{host.endpoint.authority}"
|
97
|
+
buffer.puts "Headers: #{request.headers.inspect}"
|
98
|
+
end
|
98
99
|
|
99
100
|
# The authority of the request must match the authority of the endpoint we are proxying to, otherwise SNI and other things won't work correctly.
|
100
101
|
request.authority = host.authority
|
data/lib/falcon/redirection.rb
CHANGED
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.33.
|
4
|
+
version: 0.33.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- examples/beer/falcon.rb
|
242
242
|
- examples/benchmark/config.ru
|
243
243
|
- examples/benchmark/falcon.rb
|
244
|
+
- examples/csv/config.ru
|
244
245
|
- examples/hello/config.ru
|
245
246
|
- examples/hello/falcon.rb
|
246
247
|
- examples/push/client.rb
|