protocol-http 0.63.0 → 0.64.0
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/request.rb +22 -0
- data/lib/protocol/http/version.rb +1 -1
- data/readme.md +4 -9
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 144524e37ab8f38f1391e711994fd1880cdce76b35586a757aa5745645ec95ee
|
|
4
|
+
data.tar.gz: 47caea36c05b7ae9bfedde624a614f9cfd4cee7b2471e0f18ccfa3645ed0b8f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: febc1afedb0368e12ec0293525e7221b8d223b9aaf9eb1e6d9987a232e05eef3492933d30ea912534bed0acf09db13e436227a049dd5db405b9f2ca6ccdff209
|
|
7
|
+
data.tar.gz: ed719d0d3d5dadb3ca0698d7fee3b56f0e80c3b6fa83e0b9f2cf05bb3dbe48587204e2ecc829b8404fe8407320fcde9f6a3aee14adf40b6dd62a2913ca60f65e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -153,6 +153,28 @@ module Protocol
|
|
|
153
153
|
return false
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
+
# Rewind the request body so it can be sent again.
|
|
157
|
+
# @returns [Boolean] Whether the request body was rewound.
|
|
158
|
+
def rewind!
|
|
159
|
+
if body = @body
|
|
160
|
+
return body.rewind
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Requests without a body can be sent again immediately.
|
|
164
|
+
return true
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Prepare the request body to be sent again, if it is safe to retry.
|
|
168
|
+
# @returns [Boolean] Whether the request was prepared for retry.
|
|
169
|
+
def retry!
|
|
170
|
+
# Only idempotent request methods can be retried safely.
|
|
171
|
+
if @method == Methods::POST || @method == Methods::PATCH || @method == Methods::CONNECT
|
|
172
|
+
return false
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
return self.rewind!
|
|
176
|
+
end
|
|
177
|
+
|
|
156
178
|
# Convert the request to a hash, suitable for serialization.
|
|
157
179
|
#
|
|
158
180
|
# @returns [Hash] The request as a hash.
|
data/readme.md
CHANGED
|
@@ -30,6 +30,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-http/
|
|
|
30
30
|
|
|
31
31
|
Please see the [project releases](https://socketry.github.io/protocol-http/releases/index) for all releases.
|
|
32
32
|
|
|
33
|
+
### v0.64.0
|
|
34
|
+
|
|
35
|
+
- Add `Protocol::HTTP::Request#rewind!` and `#retry!` for preparing requests to be sent again.
|
|
36
|
+
|
|
33
37
|
### v0.63.0
|
|
34
38
|
|
|
35
39
|
- Add support for the HTTP `QUERY` method.
|
|
@@ -75,15 +79,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea
|
|
|
75
79
|
- Update `Headers#[]=` to use `coerce(value)` for smart conversion of user input.
|
|
76
80
|
- Normalization (e.g., lowercasing) is applied by `parse`, `coerce`, and `<<` methods, but not by `new` when given arrays.
|
|
77
81
|
|
|
78
|
-
### v0.55.0
|
|
79
|
-
|
|
80
|
-
- **Breaking**: Move `Protocol::HTTP::Header::QuotedString` to `Protocol::HTTP::QuotedString` for better reusability.
|
|
81
|
-
- **Breaking**: Handle cookie key/value pairs using `QuotedString` as per RFC 6265.
|
|
82
|
-
- Don't use URL encoding for cookie key/value.
|
|
83
|
-
- **Breaking**: Remove `Protocol::HTTP::URL` and `Protocol::HTTP::Reference` – replaced by `Protocol::URL` gem.
|
|
84
|
-
- `Protocol::HTTP::URL` -\> `Protocol::URL::Encoding`.
|
|
85
|
-
- `Protocol::HTTP::Reference` -\> `Protocol::URL::Reference`.
|
|
86
|
-
|
|
87
82
|
## See Also
|
|
88
83
|
|
|
89
84
|
- [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|