falcon 0.36.7 → 0.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/falcon/adapters/rack.rb +0 -6
- data/lib/falcon/controller/serve.rb +1 -1
- data/lib/falcon/service/application.rb +1 -1
- data/lib/falcon/version.rb +1 -1
- data/lib/rack/handler/falcon.rb +1 -1
- metadata +5 -6
- data/lib/falcon/adapters/early_hints.rb +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4782dc46b5fdcb6bf6c35acc0625b5a3d47ed1a6b7a89adeda2394655b18e8
|
4
|
+
data.tar.gz: f4537810062e05df5b2172b86fc372f45ea872a731c5b680f729dced2f797f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0a99c4c4ffaf855a664dcc8d024ba5bee3ba5e6fd6063bb9fbb6752bec67cf83478603611d8a40ab9263f730f5e069d3317576d108eba68092f75ee6fdd4ea
|
7
|
+
data.tar.gz: 80768feb13fb6e5b794db6aa2f116bdefb8a5944d2253c3f28c2e472a502e112410e7e91e1a094431069991a25b534c21b944a5d82b7fc8ee6078b7e73bd539c
|
data/lib/falcon/adapters/rack.rb
CHANGED
@@ -24,7 +24,6 @@ require 'rack'
|
|
24
24
|
|
25
25
|
require_relative 'input'
|
26
26
|
require_relative 'response'
|
27
|
-
require_relative 'early_hints'
|
28
27
|
|
29
28
|
require 'async/logger'
|
30
29
|
|
@@ -60,7 +59,6 @@ module Falcon
|
|
60
59
|
RACK_HIJACK = 'rack.hijack'
|
61
60
|
RACK_IS_HIJACK = 'rack.hijack?'
|
62
61
|
RACK_HIJACK_IO = 'rack.hijack_io'
|
63
|
-
RACK_EARLY_HINTS = "rack.early_hints"
|
64
62
|
|
65
63
|
# Async::HTTP specific metadata:
|
66
64
|
|
@@ -184,10 +182,6 @@ module Falcon
|
|
184
182
|
|
185
183
|
self.unwrap_request(request, env)
|
186
184
|
|
187
|
-
if request.push?
|
188
|
-
env[RACK_EARLY_HINTS] = EarlyHints.new(request)
|
189
|
-
end
|
190
|
-
|
191
185
|
full_hijack = false
|
192
186
|
|
193
187
|
if request.hijack?
|
@@ -102,7 +102,7 @@ module Falcon
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
server = Falcon::Server.new(app, @bound_endpoint, @endpoint.protocol, @endpoint.scheme)
|
105
|
+
server = Falcon::Server.new(app, @bound_endpoint, protocol: @endpoint.protocol, scheme: @endpoint.scheme)
|
106
106
|
|
107
107
|
server.run
|
108
108
|
|
@@ -90,7 +90,7 @@ module Falcon
|
|
90
90
|
Async(logger: logger) do |task|
|
91
91
|
Async.logger.info(self) {"Starting application server for #{self.root}..."}
|
92
92
|
|
93
|
-
server = Server.new(self.middleware, @bound_endpoint, protocol, scheme)
|
93
|
+
server = Server.new(self.middleware, @bound_endpoint, protocol: protocol, scheme: scheme)
|
94
94
|
|
95
95
|
server.run
|
96
96
|
|
data/lib/falcon/version.rb
CHANGED
data/lib/rack/handler/falcon.rb
CHANGED
@@ -32,7 +32,7 @@ module Rack
|
|
32
32
|
app = ::Falcon::Adapters::Rack.new(app)
|
33
33
|
app = ::Falcon::Adapters::Rewindable.new(app)
|
34
34
|
|
35
|
-
server = ::Falcon::Server.new(app, endpoint, Async::HTTP::Protocol::HTTP1, SCHEME)
|
35
|
+
server = ::Falcon::Server.new(app, endpoint, protocol: Async::HTTP::Protocol::HTTP1, scheme: SCHEME)
|
36
36
|
yield server if block_given?
|
37
37
|
|
38
38
|
Async::Reactor.run do
|
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.
|
4
|
+
version: 0.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.54.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.54.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: async-http-cache
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,7 +260,6 @@ files:
|
|
260
260
|
- bin/falcon
|
261
261
|
- bin/falcon-host
|
262
262
|
- lib/falcon.rb
|
263
|
-
- lib/falcon/adapters/early_hints.rb
|
264
263
|
- lib/falcon/adapters/input.rb
|
265
264
|
- lib/falcon/adapters/output.rb
|
266
265
|
- lib/falcon/adapters/rack.rb
|
@@ -323,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
322
|
- !ruby/object:Gem::Version
|
324
323
|
version: '0'
|
325
324
|
requirements: []
|
326
|
-
rubygems_version: 3.
|
325
|
+
rubygems_version: 3.2.3
|
327
326
|
signing_key:
|
328
327
|
specification_version: 4
|
329
328
|
summary: A fast, asynchronous, rack-compatible web server.
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
22
|
-
|
23
|
-
require 'protocol/http/middleware'
|
24
|
-
|
25
|
-
module Falcon
|
26
|
-
module Adapters
|
27
|
-
# Provide an interface for advising the client to preload related resources.
|
28
|
-
class EarlyHints
|
29
|
-
PRELOAD = /<(?<path>.*?)>;.*?rel=preload/
|
30
|
-
|
31
|
-
# Initialize the early hints interface.
|
32
|
-
#
|
33
|
-
# @parameter request [Protocol::HTTP::Request]
|
34
|
-
def initialize(request)
|
35
|
-
@request = request
|
36
|
-
end
|
37
|
-
|
38
|
-
# Advise the request that the specified path should be preloaded.
|
39
|
-
# @parameter path [String]
|
40
|
-
# @parameter preload [Boolean] whether the client should preload the resource.
|
41
|
-
def push(path, preload: true, **options)
|
42
|
-
@request.push(path)
|
43
|
-
end
|
44
|
-
|
45
|
-
# Extract link headers and invoke {push}.
|
46
|
-
def call(headers)
|
47
|
-
headers.each do |key, value|
|
48
|
-
if key.casecmp("link").zero? and match = PRELOAD.match(value)
|
49
|
-
@request.push(match[:path])
|
50
|
-
else
|
51
|
-
Async.logger.warn(@request) {"Unsure how to handle early hints header: #{key}"}
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|