Skip to content

Commit ed5aad7

Browse files
authored
Add QUERY method. (#105)
1 parent a2f2d1c commit ed5aad7

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎lib/protocol/http/methods.rb‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module HTTP
1818
# | OPTIONS | Optional | Yes | Yes | Yes | No |
1919
# | TRACE | No | Yes | Yes | Yes | No |
2020
# | PATCH | Yes | Yes | No | No | No |
21+
# | QUERY | Yes | Yes | Yes | Yes | Yes |
2122
#
2223
# These methods are defined in this module using lower case names. They are for convenience only and you should not overload those methods.
2324
#
@@ -50,6 +51,9 @@ class Methods
5051
# The PATCH method applies partial modifications to a resource.
5152
PATCH = "PATCH"
5253

54+
# The QUERY method performs a read-only, idempotent query using a request body.
55+
QUERY = "QUERY"
56+
5357
# Check if the given name is a valid HTTP method, according to this module.
5458
#
5559
# Note that this method only knows about the methods defined in this module, however there are many other methods defined in different specifications.

‎releases.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## Unreleased
4+
5+
- Add support for the HTTP `QUERY` method.
6+
37
## v0.62.1
48

59
- Fix handling of `Stream#read(0)`, it must return a mutable string (or clear the given buffer).

‎test/protocol/http/methods.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
it_behaves_like ValidMethod, "OPTIONS"
3434
it_behaves_like ValidMethod, "TRACE"
3535
it_behaves_like ValidMethod, "CONNECT"
36+
it_behaves_like ValidMethod, "QUERY"
3637

37-
it "defines exactly 9 methods" do
38-
expect(subject.constants.length).to be == 9
38+
it "defines exactly 10 methods" do
39+
expect(subject.constants.length).to be == 10
3940
end
4041

4142
with ".valid?" do

0 commit comments

Comments
 (0)