protocol-http 0.24.4 → 0.24.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: 83d38d0dafbaffa0935bd4ab90a6148cfb23f28d9c127c614f6bcd2cc7a1eca3
4
- data.tar.gz: 348aa54b4f61f7af9d7090f96c8539f34a19de1a53f183ece45f303fe3a85008
3
+ metadata.gz: 99ee760d8cdfa506bbd2fdb32cbd17d313f97167900aa6a1ee55e015dfbc7ce7
4
+ data.tar.gz: 51ee0fee088bcfe378ced1e9992d528555368b10d1f7be07a257ac1afb020166
5
5
  SHA512:
6
- metadata.gz: 554ffff4bce62770aca71d6e206d1dbc8b4868f2402dbcf88a20bd60297ed66dab1279deb7f3407468e3a05bf3d2c7a217d4345442ec790eb054acbcea988348
7
- data.tar.gz: e3cee84345893f9cae5ec6a83740164cf5f4cc38b51295520e84f7dcf735a6f6bca21cac01c669b3c513bebb2f322029fd296214085442d1c8df8cb9d55e4790
6
+ metadata.gz: 83ed4f916d7557b95814717dd2203d66bd3dd5894dd4996134fb9e57bcca176351d770f5b4fdf1ac3ae10f32fc7ef8e7e9648d605ca01189d8bca2743bad39be
7
+ data.tar.gz: 03c0d2a87ae6fd331d771cad6c0c38bd1dbc4bab59cb42c2a2a9ce4b0815aca0a2f8733f0127cc74a045afa90cc314d7cc9119fbc7b12837e255497e9a25588d
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- gn1W���K�e��~��j/���)8��1$��� 8E_���\�ݼ�-8���J.��p�ɼgg5(L��AJ4n �/Q�)�Un$H�,��̛vR�6O.���}L�|�A�xn��\q�V���.�p=Xa�j����MO���ìĂ9 ;��b����M��1;�R���� L�ix�գ�^�N��-;�i��e& �o�U�]$��-����8����z��%+BQX���E����Nah42��^0&��=�z]T~m�܀�
1
+ }}\L.(a����2_���(���H�K��4�;�G��l��wGm��)��%�/�R>Tl
2
+ (�xi�_�d�Q�6�|��N�vZ}�ĎĔ���N����eRj9b ��
@@ -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
@@ -239,6 +240,14 @@ module Protocol
239
240
  # Custom headers:
240
241
  'set-cookie' => Header::SetCookie,
241
242
  'cookie' => Header::Cookie,
243
+
244
+ # Date headers:
245
+ # These headers include a comma as part of the formatting so they can't be concatenated.
246
+ 'date' => Header::Date,
247
+ 'expires' => Header::Date,
248
+ 'last-modified' => Header::Date,
249
+ 'if-modified-since' => Header::Date,
250
+ 'if-unmodified-since' => Header::Date,
242
251
  }.tap{|hash| hash.default = Split}
243
252
 
244
253
  # Delete all headers with the given key, and return the merged value.
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.24.4"
8
+ VERSION = "0.24.6"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  Provides abstractions for working with the HTTP protocol.
4
4
 
5
- [![Development
6
- Status](https://github.com/socketry/protocol-http/workflows/Test/badge.svg)](https://github.com/socketry/protocol-http/actions?workflow=Test)
5
+ [![Development Status](https://github.com/socketry/protocol-http/workflows/Test/badge.svg)](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
4
+ version: 0.24.6
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-06-30 00:00:00.000000000 Z
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-02 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: '2.5'
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.7
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