falcon 0.40.1 → 0.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/falcon/adapters/output.rb +23 -5
- data/lib/falcon/adapters/response.rb +1 -1
- data/lib/falcon/environments/tls.rb +1 -2
- data/lib/falcon/tls.rb +0 -2
- data/lib/falcon/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +46 -32
- metadata.gz.sig +0 -0
- data/lib/falcon/extensions/openssl.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ea41a48b0da7b6ba65df7bd8f3c63c06a8deb498119079f8ca03367bc78cfa5
|
4
|
+
data.tar.gz: 79e5693fc78e56b829d88b6addffe4d255fa09629cf201356192eb70563e1036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d97ae8f6aebe79fa10c410ca4ba038a731b6ace354b2bcc2bd8ec0d5a958fefed7c89d5bd47141fbb0e2f8fbbac869476e6bc1c552a8034ddc9b5835e9278d4c
|
7
|
+
data.tar.gz: '080b0ac4a57575b3177024248fa538d7019f3812eed267a3fd5ca9b7de7cc9388759d55c51a6b0de6b2aa71788b69f2bbc08e08488415f3cfc7e54d3707f8a14'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -35,19 +35,37 @@ module Falcon
|
|
35
35
|
# @parameter status [Integer] The response status.
|
36
36
|
# @parameter headers [Protocol::HTTP::Headers] The response headers.
|
37
37
|
# @parameter body [Object] The `rack` response body.
|
38
|
-
def self.wrap(status, headers, body)
|
38
|
+
def self.wrap(status, headers, body, request = nil)
|
39
39
|
# In no circumstance do we want this header propagating out:
|
40
40
|
if length = headers.delete(CONTENT_LENGTH)
|
41
41
|
# We don't really trust the user to provide the right length to the transport.
|
42
42
|
length = Integer(length)
|
43
43
|
end
|
44
44
|
|
45
|
+
# If we have an Async::HTTP body, we return it directly:
|
45
46
|
if body.is_a?(::Protocol::HTTP::Body::Readable)
|
47
|
+
# warn "Returning #{body.class} as body is falcon-specific and may be removed in the future!"
|
46
48
|
return body
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
# Otherwise, we have a more typical response body:
|
52
|
+
if status == 200 and body.respond_to?(:to_path)
|
53
|
+
begin
|
54
|
+
# Don't mangle partial responses (206)
|
55
|
+
return ::Protocol::HTTP::Body::File.open(body.to_path).tap do
|
56
|
+
body.close if body.respond_to?(:close) # Close the original body.
|
57
|
+
end
|
58
|
+
rescue Errno::ENOENT
|
59
|
+
# If the file is not available, ignore.
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# If we have a streaming body, we hijack the connection:
|
64
|
+
unless body.respond_to?(:each)
|
65
|
+
return Async::HTTP::Body::Hijack.new(body, request&.body)
|
66
|
+
end
|
67
|
+
|
68
|
+
if body.is_a?(Array)
|
51
69
|
length ||= body.sum(&:bytesize)
|
52
70
|
return self.new(body, length)
|
53
71
|
else
|
@@ -20,7 +20,6 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
|
-
require_relative '../extensions/openssl'
|
24
23
|
require_relative '../controller/proxy'
|
25
24
|
require_relative '../tls'
|
26
25
|
|
@@ -46,7 +45,7 @@ environment(:tls) do
|
|
46
45
|
# The list of certificates loaded from that path.
|
47
46
|
# @attribute [Array(OpenSSL::X509::Certificate)]
|
48
47
|
ssl_certificates do
|
49
|
-
OpenSSL::X509.
|
48
|
+
OpenSSL::X509::Certificate.load_file(ssl_certificate_path)
|
50
49
|
end
|
51
50
|
|
52
51
|
# The main certificate.
|
data/lib/falcon/tls.rb
CHANGED
data/lib/falcon/version.rb
CHANGED
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.
|
4
|
+
version: 0.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -27,33 +27,34 @@ bindir: bin
|
|
27
27
|
cert_chain:
|
28
28
|
- |
|
29
29
|
-----BEGIN CERTIFICATE-----
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
30
|
+
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
|
31
|
+
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
|
32
|
+
CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
|
33
|
+
MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
|
34
|
+
MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
|
35
|
+
bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
|
36
|
+
igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
|
37
|
+
9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
|
38
|
+
sGkaOY0eq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vBqEUe+yo6DKIT3MtGE2+CP
|
53
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
54
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
55
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
55
56
|
-----END CERTIFICATE-----
|
56
|
-
date: 2022-07
|
57
|
+
date: 2022-08-07 00:00:00.000000000 Z
|
57
58
|
dependencies:
|
58
59
|
- !ruby/object:Gem::Dependency
|
59
60
|
name: async
|
@@ -89,14 +90,14 @@ dependencies:
|
|
89
90
|
requirements:
|
90
91
|
- - "~>"
|
91
92
|
- !ruby/object:Gem::Version
|
92
|
-
version: 0.
|
93
|
+
version: 0.57.0
|
93
94
|
type: :runtime
|
94
95
|
prerelease: false
|
95
96
|
version_requirements: !ruby/object:Gem::Requirement
|
96
97
|
requirements:
|
97
98
|
- - "~>"
|
98
99
|
- !ruby/object:Gem::Version
|
99
|
-
version: 0.
|
100
|
+
version: 0.57.0
|
100
101
|
- !ruby/object:Gem::Dependency
|
101
102
|
name: async-http-cache
|
102
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,6 +168,20 @@ dependencies:
|
|
167
168
|
- - "~>"
|
168
169
|
- !ruby/object:Gem::Version
|
169
170
|
version: '1.1'
|
171
|
+
- !ruby/object:Gem::Dependency
|
172
|
+
name: openssl
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - "~>"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '3.0'
|
178
|
+
type: :runtime
|
179
|
+
prerelease: false
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - "~>"
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '3.0'
|
170
185
|
- !ruby/object:Gem::Dependency
|
171
186
|
name: process-metrics
|
172
187
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,14 +258,14 @@ dependencies:
|
|
243
258
|
requirements:
|
244
259
|
- - "~>"
|
245
260
|
- !ruby/object:Gem::Version
|
246
|
-
version: 0.
|
261
|
+
version: 0.19.2
|
247
262
|
type: :development
|
248
263
|
prerelease: false
|
249
264
|
version_requirements: !ruby/object:Gem::Requirement
|
250
265
|
requirements:
|
251
266
|
- - "~>"
|
252
267
|
- !ruby/object:Gem::Version
|
253
|
-
version: 0.
|
268
|
+
version: 0.19.2
|
254
269
|
- !ruby/object:Gem::Dependency
|
255
270
|
name: bake
|
256
271
|
requirement: !ruby/object:Gem::Requirement
|
@@ -334,7 +349,6 @@ files:
|
|
334
349
|
- lib/falcon/environments/self_signed_tls.rb
|
335
350
|
- lib/falcon/environments/supervisor.rb
|
336
351
|
- lib/falcon/environments/tls.rb
|
337
|
-
- lib/falcon/extensions/openssl.rb
|
338
352
|
- lib/falcon/middleware/proxy.rb
|
339
353
|
- lib/falcon/middleware/redirect.rb
|
340
354
|
- lib/falcon/middleware/verbose.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright, 2018, 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 'openssl/x509'
|
24
|
-
|
25
|
-
module OpenSSL
|
26
|
-
module X509
|
27
|
-
CERTIFICATE_PATTERN = /-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m
|
28
|
-
|
29
|
-
# An extension to load an array of certificates from a file at the given path.
|
30
|
-
def self.load_certificates(path)
|
31
|
-
File.read(path).scan(CERTIFICATE_PATTERN).collect do |text|
|
32
|
-
Certificate.new(text)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|