falcon 0.48.4 → 0.48.6

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: 1b4caa19c4227d2fdeeb8a700a20be255a12f3bee3d2aa69ea31d9a8c7a2508b
4
- data.tar.gz: 6ae1117406cc230dad0447a43fd35ef94b1361dbe196a3e1e2ebd29700a7e228
3
+ metadata.gz: 2a6198414f38d568e93d77452b6efa9b4f9267a5beedb57b8c7a96bd72a174cd
4
+ data.tar.gz: 164f1aa2a4407eba29965a0c1acc85364ad734b6a2aa1215d408b3d1e67bd4f5
5
5
  SHA512:
6
- metadata.gz: 75086f0c0c1c552b9201d26b2ef3c3cc394ecb64c596642ff62ad73c361fac5493b867aa19becfd1aa4b6e0b7dfe1abba334c276df2ba5ca0dc194df759f007c
7
- data.tar.gz: d19a36195d9521d3ac0d7ae4db56b6521cfd0e2bfbaf5ade95408c8cd557d6bf3c8733cda818a84980c61fed3a05fce936af85fb53807d15216ab4d8a88733e1
6
+ metadata.gz: e6942fa58fda793327bfcb767a0e729f2417c90d4dcdb7bbdc9f1a8c81492575b95fc96ee294b69e555322d643f3dd8b0443b38f3efb92a3eb31f68d445ad34e
7
+ data.tar.gz: 8d4dcc4a530b7eaf74055e893fec7e101fa8e2419d9dc59713064f54fb679a566091f162220ecf5e25cbcf312db52a4f503dd65fb8398cf1f06c00dbab4ad39a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -152,6 +152,9 @@ module Falcon
152
152
  def call(request)
153
153
  attributes = {
154
154
  "authority" => request.authority,
155
+ "method" => request.method,
156
+ "path" => request.path,
157
+ "version" => request.version,
155
158
  }
156
159
 
157
160
  Traces.trace("falcon.middleware.proxy.call", attributes: attributes) do
@@ -50,6 +50,8 @@ module Falcon
50
50
  location = "#{@endpoint.scheme}://#{host.authority}:#{@endpoint.port}#{request.path}"
51
51
  end
52
52
 
53
+ Console.info(self, "Redirecting incoming request...", request: request, location: location)
54
+
53
55
  return Protocol::HTTP::Response[301, [["location", location]], []]
54
56
  else
55
57
  super
@@ -13,7 +13,7 @@ module Falcon
13
13
  # Initialize the verbose middleware.
14
14
  # @parameter app [Protocol::HTTP::Middleware] The middleware to wrap.
15
15
  # @parameter logger [Console::Logger] The logger to use.
16
- def initialize(app, logger = Console.logger)
16
+ def initialize(app, logger = Console)
17
17
  super(app)
18
18
 
19
19
  @logger = logger
@@ -24,7 +24,7 @@ module Falcon
24
24
  task = Async::Task.current
25
25
  address = request.remote_address
26
26
 
27
- @logger.info(request) {"Headers: #{request.headers.to_h} from #{address.inspect}"}
27
+ @logger.info(request, "-> #{request.method} #{request.path}", headers: request.headers.to_h, address: address.inspect)
28
28
 
29
29
  task.annotate("#{request.method} #{request.path} from #{address.inspect}")
30
30
  end
@@ -37,10 +37,8 @@ module Falcon
37
37
 
38
38
  response = super
39
39
 
40
- statistics.wrap(response) do |statistics, error|
41
- @logger.info(request) {"Responding with: #{response.status} #{response.headers.to_h}; #{statistics.inspect}"}
42
-
43
- @logger.error(request) {"#{error.class}: #{error.message}"} if error
40
+ statistics.wrap(response) do |body, error|
41
+ @logger.info(request, "<- #{request.method} #{request.path}", headers: response.headers.to_h, status: response.status, body: body.inspect, error: error)
44
42
  end
45
43
 
46
44
  return response
data/lib/falcon/server.rb CHANGED
@@ -9,7 +9,6 @@ require "protocol/http/middleware/builder"
9
9
  require "protocol/http/content_encoding"
10
10
 
11
11
  require "async/http/cache"
12
-
13
12
  require_relative "middleware/verbose"
14
13
  require "protocol/rack"
15
14
 
@@ -18,7 +17,7 @@ module Falcon
18
17
  class Server < Async::HTTP::Server
19
18
  # Wrap a rack application into a middleware suitable the server.
20
19
  # @parameter rack_app [Proc | Object] A rack application/middleware.
21
- # @parameter verbose [Boolean] Whether to add the {Verbose} middleware.
20
+ # @parameter verbose [Boolean] Whether to add the {Middleware::Verbose} middleware.
22
21
  # @parameter cache [Boolean] Whether to add the {Async::HTTP::Cache} middleware.
23
22
  def self.middleware(rack_app, verbose: false, cache: true)
24
23
  ::Protocol::HTTP::Middleware.build do
@@ -31,8 +30,8 @@ module Falcon
31
30
  end
32
31
 
33
32
  use ::Protocol::HTTP::ContentEncoding
34
- use ::Protocol::Rack::Adapter
35
33
 
34
+ use ::Protocol::Rack::Adapter
36
35
  run rack_app
37
36
  end
38
37
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Falcon
7
- VERSION = "0.48.4"
7
+ VERSION = "0.48.6"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.4
4
+ version: 0.48.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -29,7 +29,6 @@ authors:
29
29
  - Stefan Buhrmester
30
30
  - Tad Thorley
31
31
  - Tasos Latsas
32
- autorequire:
33
32
  bindir: bin
34
33
  cert_chain:
35
34
  - |
@@ -61,7 +60,7 @@ cert_chain:
61
60
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
62
61
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
63
62
  -----END CERTIFICATE-----
64
- date: 2025-01-04 00:00:00.000000000 Z
63
+ date: 2025-01-29 00:00:00.000000000 Z
65
64
  dependencies:
66
65
  - !ruby/object:Gem::Dependency
67
66
  name: async
@@ -231,8 +230,6 @@ dependencies:
231
230
  - - "~>"
232
231
  - !ruby/object:Gem::Version
233
232
  version: '2.3'
234
- description:
235
- email:
236
233
  executables:
237
234
  - falcon
238
235
  - falcon-host
@@ -291,7 +288,6 @@ licenses:
291
288
  metadata:
292
289
  documentation_uri: https://socketry.github.io/falcon/
293
290
  source_code_uri: https://github.com/socketry/falcon.git
294
- post_install_message:
295
291
  rdoc_options: []
296
292
  require_paths:
297
293
  - lib
@@ -306,8 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
302
  - !ruby/object:Gem::Version
307
303
  version: '0'
308
304
  requirements: []
309
- rubygems_version: 3.5.22
310
- signing_key:
305
+ rubygems_version: 3.6.2
311
306
  specification_version: 4
312
307
  summary: A fast, asynchronous, rack-compatible web server.
313
308
  test_files: []
metadata.gz.sig CHANGED
Binary file