falcon 0.48.5 → 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: 8ef2381f9e160ea759eb3514031d4503c04f757b0678b5d7ad3342392a55bc5b
4
- data.tar.gz: 688e89fbbf7b410fa3be7bb9d570e2d6047b750bae36237a17b6837766eefbd7
3
+ metadata.gz: 2a6198414f38d568e93d77452b6efa9b4f9267a5beedb57b8c7a96bd72a174cd
4
+ data.tar.gz: 164f1aa2a4407eba29965a0c1acc85364ad734b6a2aa1215d408b3d1e67bd4f5
5
5
  SHA512:
6
- metadata.gz: 7d183d3ea35bebecc7df5c360c20cda41fcf1e6b126f287d4dd9387d8911d0a24ef7b20221945efa9acd7451d9e9b053bef326bd9a53a0e55756fc283d427402
7
- data.tar.gz: d9261f7e20b4d95d6519e1c70a70c34f0f243207ea72bbe8b9d340414b00ba73542229cc5c5d2a0054cef624fa0f1ff413bbb3580a27d610cbf46587459c43b0
6
+ metadata.gz: e6942fa58fda793327bfcb767a0e729f2417c90d4dcdb7bbdc9f1a8c81492575b95fc96ee294b69e555322d643f3dd8b0443b38f3efb92a3eb31f68d445ad34e
7
+ data.tar.gz: 8d4dcc4a530b7eaf74055e893fec7e101fa8e2419d9dc59713064f54fb679a566091f162220ecf5e25cbcf312db52a4f503dd65fb8398cf1f06c00dbab4ad39a
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/falcon/server.rb CHANGED
@@ -10,7 +10,6 @@ require "protocol/http/content_encoding"
10
10
 
11
11
  require "async/http/cache"
12
12
  require_relative "middleware/verbose"
13
- require_relative "middleware/validate"
14
13
  require "protocol/rack"
15
14
 
16
15
  module Falcon
@@ -18,19 +17,14 @@ 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 validate [Boolean] Whether to add the {Middleware::Validate} middleware.
22
20
  # @parameter verbose [Boolean] Whether to add the {Middleware::Verbose} middleware.
23
21
  # @parameter cache [Boolean] Whether to add the {Async::HTTP::Cache} middleware.
24
- def self.middleware(rack_app, verbose: false, validate: true, cache: true)
22
+ def self.middleware(rack_app, verbose: false, cache: true)
25
23
  ::Protocol::HTTP::Middleware.build do
26
24
  if verbose
27
25
  use Middleware::Verbose
28
26
  end
29
27
 
30
- if validate
31
- use Middleware::Validate
32
- end
33
-
34
28
  if cache
35
29
  use Async::HTTP::Cache::General
36
30
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Falcon
7
- VERSION = "0.48.5"
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.5
4
+ version: 0.48.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -60,7 +60,7 @@ cert_chain:
60
60
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
61
61
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
62
62
  -----END CERTIFICATE-----
63
- date: 2025-01-28 00:00:00.000000000 Z
63
+ date: 2025-01-29 00:00:00.000000000 Z
64
64
  dependencies:
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: async
@@ -267,7 +267,6 @@ files:
267
267
  - lib/falcon/environment/virtual.rb
268
268
  - lib/falcon/middleware/proxy.rb
269
269
  - lib/falcon/middleware/redirect.rb
270
- - lib/falcon/middleware/validate.rb
271
270
  - lib/falcon/middleware/verbose.rb
272
271
  - lib/falcon/proxy_endpoint.rb
273
272
  - lib/falcon/rackup/handler.rb
metadata.gz.sig CHANGED
Binary file
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2025, by Samuel Williams.
5
-
6
- module Falcon
7
- module Middleware
8
- # A HTTP middleware for validating incoming requests.
9
- class Validate < Protocol::HTTP::Middleware
10
- # Initialize the validate middleware.
11
- # @parameter app [Protocol::HTTP::Middleware] The middleware to wrap.
12
- def initialize(app)
13
- super(app)
14
- end
15
-
16
- # Validate the incoming request.
17
- def call(request)
18
- unless request.path.start_with?("/")
19
- return Protocol::HTTP::Response[400, {}, ["Invalid request path!"]]
20
- end
21
-
22
- return super
23
- end
24
- end
25
- end
26
- end