protocol-http 0.24.4 → 0.24.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http/header/date.rb +22 -0
- data/lib/protocol/http/headers.rb +9 -2
- data/lib/protocol/http/version.rb +1 -1
- data/readme.md +9 -2
- data.tar.gz.sig +0 -0
- metadata +6 -48
- metadata.gz.sig +0 -0
- data/conduct.md +0 -133
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8883fd0b19af80ae8276396f1f122822a8091ab5472a4b474cab27d99000d3ed
|
4
|
+
data.tar.gz: a3460cb8df3b9a75e43e6dffb81bd4784b6b3b50d5d88b19c9495c0368f8f9ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f87c3e94f646878d73ab53121c716df5476fa70523d45605e2ad2d83cc52bd36ecca9a59b34d4f3d7b28d44a6a5d6c60dd20b47f542caa97f9f29374cd4591
|
7
|
+
data.tar.gz: d975d277a0d58ab7b1d94b36c60aafefac781e5da84623e7abdb928c81734166f2469a08f6bde0747596452652e58d7044d93d6d1902a37d915f60e1f68238a9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2023, by Samuel Williams.
|
5
|
+
|
6
|
+
require 'time'
|
7
|
+
|
8
|
+
module Protocol
|
9
|
+
module HTTP
|
10
|
+
module Header
|
11
|
+
class Date < String
|
12
|
+
def << value
|
13
|
+
replace(value)
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_time
|
17
|
+
::Time.parse(self)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -12,6 +12,7 @@ require_relative 'header/etag'
|
|
12
12
|
require_relative 'header/etags'
|
13
13
|
require_relative 'header/vary'
|
14
14
|
require_relative 'header/authorization'
|
15
|
+
require_relative 'header/date'
|
15
16
|
|
16
17
|
module Protocol
|
17
18
|
module HTTP
|
@@ -208,8 +209,6 @@ module Protocol
|
|
208
209
|
'user-agent' => false,
|
209
210
|
'referer' => false,
|
210
211
|
'host' => false,
|
211
|
-
'if-modified-since' => false,
|
212
|
-
'if-unmodified-since' => false,
|
213
212
|
'from' => false,
|
214
213
|
'location' => false,
|
215
214
|
'max-forwards' => false,
|
@@ -239,6 +238,14 @@ module Protocol
|
|
239
238
|
# Custom headers:
|
240
239
|
'set-cookie' => Header::SetCookie,
|
241
240
|
'cookie' => Header::Cookie,
|
241
|
+
|
242
|
+
# Date headers:
|
243
|
+
# These headers include a comma as part of the formatting so they can't be concatenated.
|
244
|
+
'date' => Header::Date,
|
245
|
+
'expires' => Header::Date,
|
246
|
+
'last-modified' => Header::Date,
|
247
|
+
'if-modified-since' => Header::Date,
|
248
|
+
'if-unmodified-since' => Header::Date,
|
242
249
|
}.tap{|hash| hash.default = Split}
|
243
250
|
|
244
251
|
# Delete all headers with the given key, and return the merged value.
|
data/readme.md
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
Provides abstractions for working with the HTTP protocol.
|
4
4
|
|
5
|
-
[](https://github.com/socketry/protocol-http/actions?workflow=Test)
|
5
|
+
[](https://github.com/socketry/protocol-http/actions?workflow=Test)
|
7
6
|
|
8
7
|
## Features
|
9
8
|
|
@@ -32,6 +31,14 @@ We welcome contributions to this project.
|
|
32
31
|
4. Push to the branch (`git push origin my-new-feature`).
|
33
32
|
5. Create new Pull Request.
|
34
33
|
|
34
|
+
### Developer Certificate of Origin
|
35
|
+
|
36
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
37
|
+
|
38
|
+
### Contributor Covenant
|
39
|
+
|
40
|
+
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
41
|
+
|
35
42
|
## See Also
|
36
43
|
|
37
44
|
- [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
|
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.24.
|
4
|
+
version: 0.24.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -44,57 +44,14 @@ cert_chain:
|
|
44
44
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
45
45
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date: 2023-
|
48
|
-
dependencies:
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: bundler
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
56
|
-
type: :development
|
57
|
-
prerelease: false
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: covered
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
name: sus
|
79
|
-
requirement: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
type: :development
|
85
|
-
prerelease: false
|
86
|
-
version_requirements: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
47
|
+
date: 2023-08-03 00:00:00.000000000 Z
|
48
|
+
dependencies: []
|
91
49
|
description:
|
92
50
|
email:
|
93
51
|
executables: []
|
94
52
|
extensions: []
|
95
53
|
extra_rdoc_files: []
|
96
54
|
files:
|
97
|
-
- conduct.md
|
98
55
|
- design.md
|
99
56
|
- lib/protocol/http.rb
|
100
57
|
- lib/protocol/http/accept_encoding.rb
|
@@ -117,6 +74,7 @@ files:
|
|
117
74
|
- lib/protocol/http/header/cache_control.rb
|
118
75
|
- lib/protocol/http/header/connection.rb
|
119
76
|
- lib/protocol/http/header/cookie.rb
|
77
|
+
- lib/protocol/http/header/date.rb
|
120
78
|
- lib/protocol/http/header/etag.rb
|
121
79
|
- lib/protocol/http/header/etags.rb
|
122
80
|
- lib/protocol/http/header/multiple.rb
|
@@ -145,14 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
103
|
requirements:
|
146
104
|
- - ">="
|
147
105
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
106
|
+
version: 2.7.6
|
149
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
108
|
requirements:
|
151
109
|
- - ">="
|
152
110
|
- !ruby/object:Gem::Version
|
153
111
|
version: '0'
|
154
112
|
requirements: []
|
155
|
-
rubygems_version: 3.4.
|
113
|
+
rubygems_version: 3.4.10
|
156
114
|
signing_key:
|
157
115
|
specification_version: 4
|
158
116
|
summary: Provides abstractions to handle HTTP protocols.
|
metadata.gz.sig
CHANGED
Binary file
|
data/conduct.md
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
|
2
|
-
# Contributor Covenant Code of Conduct
|
3
|
-
|
4
|
-
## Our Pledge
|
5
|
-
|
6
|
-
We as members, contributors, and leaders pledge to make participation in our
|
7
|
-
community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
9
|
-
identity and expression, level of experience, education, socio-economic status,
|
10
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
11
|
-
identity and orientation.
|
12
|
-
|
13
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
14
|
-
diverse, inclusive, and healthy community.
|
15
|
-
|
16
|
-
## Our Standards
|
17
|
-
|
18
|
-
Examples of behavior that contributes to a positive environment for our
|
19
|
-
community include:
|
20
|
-
|
21
|
-
* Demonstrating empathy and kindness toward other people
|
22
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
23
|
-
* Giving and gracefully accepting constructive feedback
|
24
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
25
|
-
and learning from the experience
|
26
|
-
* Focusing on what is best not just for us as individuals, but for the overall
|
27
|
-
community
|
28
|
-
|
29
|
-
Examples of unacceptable behavior include:
|
30
|
-
|
31
|
-
* The use of sexualized language or imagery, and sexual attention or advances of
|
32
|
-
any kind
|
33
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
34
|
-
* Public or private harassment
|
35
|
-
* Publishing others' private information, such as a physical or email address,
|
36
|
-
without their explicit permission
|
37
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
38
|
-
professional setting
|
39
|
-
|
40
|
-
## Enforcement Responsibilities
|
41
|
-
|
42
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
43
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
44
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
45
|
-
or harmful.
|
46
|
-
|
47
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
48
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
49
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
50
|
-
decisions when appropriate.
|
51
|
-
|
52
|
-
## Scope
|
53
|
-
|
54
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
55
|
-
an individual is officially representing the community in public spaces.
|
56
|
-
Examples of representing our community include using an official e-mail address,
|
57
|
-
posting via an official social media account, or acting as an appointed
|
58
|
-
representative at an online or offline event.
|
59
|
-
|
60
|
-
## Enforcement
|
61
|
-
|
62
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
63
|
-
reported to the community leaders responsible for enforcement at
|
64
|
-
[INSERT CONTACT METHOD].
|
65
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
66
|
-
|
67
|
-
All community leaders are obligated to respect the privacy and security of the
|
68
|
-
reporter of any incident.
|
69
|
-
|
70
|
-
## Enforcement Guidelines
|
71
|
-
|
72
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
73
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
74
|
-
|
75
|
-
### 1. Correction
|
76
|
-
|
77
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
78
|
-
unprofessional or unwelcome in the community.
|
79
|
-
|
80
|
-
**Consequence**: A private, written warning from community leaders, providing
|
81
|
-
clarity around the nature of the violation and an explanation of why the
|
82
|
-
behavior was inappropriate. A public apology may be requested.
|
83
|
-
|
84
|
-
### 2. Warning
|
85
|
-
|
86
|
-
**Community Impact**: A violation through a single incident or series of
|
87
|
-
actions.
|
88
|
-
|
89
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
90
|
-
interaction with the people involved, including unsolicited interaction with
|
91
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
92
|
-
includes avoiding interactions in community spaces as well as external channels
|
93
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
94
|
-
ban.
|
95
|
-
|
96
|
-
### 3. Temporary Ban
|
97
|
-
|
98
|
-
**Community Impact**: A serious violation of community standards, including
|
99
|
-
sustained inappropriate behavior.
|
100
|
-
|
101
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
102
|
-
communication with the community for a specified period of time. No public or
|
103
|
-
private interaction with the people involved, including unsolicited interaction
|
104
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
105
|
-
Violating these terms may lead to a permanent ban.
|
106
|
-
|
107
|
-
### 4. Permanent Ban
|
108
|
-
|
109
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
110
|
-
standards, including sustained inappropriate behavior, harassment of an
|
111
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
112
|
-
|
113
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
114
|
-
community.
|
115
|
-
|
116
|
-
## Attribution
|
117
|
-
|
118
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
119
|
-
version 2.1, available at
|
120
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
121
|
-
|
122
|
-
Community Impact Guidelines were inspired by
|
123
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
124
|
-
|
125
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
126
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
127
|
-
[https://www.contributor-covenant.org/translations][translations].
|
128
|
-
|
129
|
-
[homepage]: https://www.contributor-covenant.org
|
130
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
131
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
132
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
133
|
-
[translations]: https://www.contributor-covenant.org/translations
|