protocol-http 0.42.0 → 0.43.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/protocol/http/peer.rb +30 -0
- data/lib/protocol/http/request.rb +7 -0
- data/lib/protocol/http/response.rb +7 -0
- data/lib/protocol/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bdd0ca9356d15e047333ae5e070710d5453bece234e484d236656edb984eb3b
|
4
|
+
data.tar.gz: eb605cfc6aa68422dd8142ba7e86fb0ec9eef55f8415e8cc0e9066af714a4aa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 493688f8e6e8a417bfdb49fd53103e07ccca2f164613e5cea2ce0298b4eb4c4e251add7c1873d178f38b1cfb984267e277c4388f60b9e36b013d1f8bac950b57
|
7
|
+
data.tar.gz: '0590a15ef7f6447efc5c84a0c6ce7e796a1b1b8d91975b10f895a5c0d9c450402f7adeb7b504785179e6fe68f776a7113050adc2458dc84e7f4330b6faec4774'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2017-2024, by Samuel Williams.
|
5
|
+
|
6
|
+
module Protocol
|
7
|
+
module HTTP
|
8
|
+
# Provide a well defined, cached representation of a peer (address).
|
9
|
+
class Peer
|
10
|
+
def self.for(io)
|
11
|
+
if address = io.remote_address
|
12
|
+
return new(address)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(address)
|
17
|
+
@address = address
|
18
|
+
|
19
|
+
if address.ip?
|
20
|
+
@ip_address = @address.ip_address
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
attr :address
|
25
|
+
attr :ip_address
|
26
|
+
|
27
|
+
alias remote_address address
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -64,6 +64,13 @@ module Protocol
|
|
64
64
|
# @attribute [Proc] a callback which is called when an interim response is received.
|
65
65
|
attr_accessor :interim_response
|
66
66
|
|
67
|
+
# A request that is generated by a server, may choose to include the peer (address) associated with the request. It should be implemented by a sub-class.
|
68
|
+
#
|
69
|
+
# @returns [Peer | Nil] The peer (address) associated with the request.
|
70
|
+
def peer
|
71
|
+
nil
|
72
|
+
end
|
73
|
+
|
67
74
|
# Send the request to the given connection.
|
68
75
|
def call(connection)
|
69
76
|
connection.call(self)
|
@@ -52,6 +52,13 @@ module Protocol
|
|
52
52
|
# @attribute [String | Array(String) | Nil] The protocol, e.g. `"websocket"`, etc.
|
53
53
|
attr_accessor :protocol
|
54
54
|
|
55
|
+
# A response that is generated by a client, may choose to include the peer (address) associated with the response. It should be implemented by a sub-class.
|
56
|
+
#
|
57
|
+
# @returns [Peer | Nil] The peer (address) associated with the response.
|
58
|
+
def peer
|
59
|
+
nil
|
60
|
+
end
|
61
|
+
|
55
62
|
# Whether the response is considered a hijack: the connection has been taken over by the application and the server should not send any more data.
|
56
63
|
def hijack?
|
57
64
|
false
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -47,7 +47,7 @@ cert_chain:
|
|
47
47
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
48
48
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
49
49
|
-----END CERTIFICATE-----
|
50
|
-
date: 2024-
|
50
|
+
date: 2024-11-09 00:00:00.000000000 Z
|
51
51
|
dependencies: []
|
52
52
|
description:
|
53
53
|
email:
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/protocol/http/methods.rb
|
89
89
|
- lib/protocol/http/middleware.rb
|
90
90
|
- lib/protocol/http/middleware/builder.rb
|
91
|
+
- lib/protocol/http/peer.rb
|
91
92
|
- lib/protocol/http/reference.rb
|
92
93
|
- lib/protocol/http/request.rb
|
93
94
|
- lib/protocol/http/response.rb
|
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
118
|
- !ruby/object:Gem::Version
|
118
119
|
version: '0'
|
119
120
|
requirements: []
|
120
|
-
rubygems_version: 3.5.
|
121
|
+
rubygems_version: 3.5.22
|
121
122
|
signing_key:
|
122
123
|
specification_version: 4
|
123
124
|
summary: Provides abstractions to handle HTTP protocols.
|
metadata.gz.sig
CHANGED
Binary file
|