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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7655ab65f434967b2981ea3cddfe9552fb7fffea93b2bfa1670cebfc70704e5b
4
- data.tar.gz: 215e9105a2a4bf81a9d12bf9ddb7aa7b9b731a55127bd8ae6ca5088d449902ef
3
+ metadata.gz: 82761b4748e08452384513f26cc7e90654ce7b0eee3c3a5a3bbabfe66cada520
4
+ data.tar.gz: 8aa7cd71bb13257e7f6021b7502911a48a14c0cc57f75fb4f6f0f57c89d23a9f
5
5
  SHA512:
6
- metadata.gz: f413d2c2f457bc283b5825fc0a867ef4470eca2cd5c69dd1b3158d4a0578092687cbd24b2a1a1cf53ef19423ae2b1ffc11b1ed55a24d3770515490aced5da143
7
- data.tar.gz: 18bdafd7abe2a96a5e9b63332b92ca9fcef1d7bc84a4b421abbe10cf52e9424b05f4566ded76c2ae41ca1f3cdbce51c9ea9b5d1ef2ed9b07a0ddbd042475dba3
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#181](https://github.com/rack/rack/pull/1181) is merged).
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.sub(/(\.)?(:\d+)?$/, '')
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
- # Async.logger.info(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
- # end
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
@@ -40,7 +40,7 @@ module Falcon
40
40
 
41
41
  def lookup(request)
42
42
  # Trailing dot and port is ignored/normalized.
43
- if authority = request.authority.sub(/(\.)?(:\d+)?$/, '')
43
+ if authority = request.authority&.sub(/(\.)?(:\d+)?$/, '')
44
44
  return @hosts[authority]
45
45
  end
46
46
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.33.8"
22
+ VERSION = "0.33.9"
23
23
  end
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.8
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-17 00:00:00.000000000 Z
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