GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add RFC 10008 QUERY Method support (#16966) (#16978) · netty/netty@ec224a0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-http/src
    • main/java/io/netty/handler/codec/http
      • HttpHeaderNames.java
      • HttpMethod.java
    • test/java/io/netty/handler/codec/http
      • HttpHeaderValidationUtilTest.java
      • HttpMethodTest.java
  • microbench/src/main/java/io/netty/handler/codec/http
    • HttpMethodMapBenchmark.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderNames.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaderNames.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public final class HttpHeaderNames {
4949
* {@code "accept-patch"}
5050
*/
5151
public static final AsciiString ACCEPT_PATCH = AsciiString.cached("accept-patch");
52+
/**
53+
* {@code "accept-query"}
54+
*/
55+
public static final AsciiString ACCEPT_QUERY = AsciiString.cached("accept-query");
5256
/**
5357
* {@code "access-control-allow-credentials"}
5458
*/
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ public class HttpMethod implements Comparable<HttpMethod> {
8585
*/
8686
public static final HttpMethod CONNECT = new HttpMethod(AsciiString.cached("CONNECT"));
8787

88+
/**
89+
* The QUERY method requests that the request target process the enclosed content in a safe and
90+
* idempotent manner and then respond with the result of that processing.
91+
*/
92+
public static final HttpMethod QUERY = new HttpMethod(AsciiString.cached("QUERY"));
93+
8894
/**
8995
* Returns the {@link HttpMethod} represented by the specified name.
9096
* If the specified name is a standard HTTP method name, a cached instance
@@ -109,6 +115,8 @@ public static HttpMethod valueOf(String name) {
109115
return HttpMethod.DELETE;
110116
} else if (name.equals("TRACE")) {
111117
return HttpMethod.TRACE;
118+
} else if (name.equals("QUERY")) {
119+
return HttpMethod.QUERY;
112120
}
113121
return new HttpMethod(name);
114122
}
Collapse file

‎codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java‎

Copy file name to clipboardExpand all lines: codec-http/src/test/java/io/netty/handler/codec/http/HttpHeaderValidationUtilTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static List<Arguments> connectionRelatedHeaders() {
5050
list.add(header(false, HttpHeaderNames.ACCEPT_LANGUAGE));
5151
list.add(header(false, HttpHeaderNames.ACCEPT_RANGES));
5252
list.add(header(false, HttpHeaderNames.ACCEPT_PATCH));
53+
list.add(header(false, HttpHeaderNames.ACCEPT_QUERY));
5354
list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_CREDENTIALS));
5455
list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS));
5556
list.add(header(false, HttpHeaderNames.ACCESS_CONTROL_ALLOW_METHODS));
Collapse file

‎codec-http/src/test/java/io/netty/handler/codec/http/HttpMethodTest.java‎

Copy file name to clipboardExpand all lines: codec-http/src/test/java/io/netty/handler/codec/http/HttpMethodTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class HttpMethodTest {
3737
public void valueOfReturnsCachedInstanceForKnownMethods() {
3838
assertSame(HttpMethod.GET, HttpMethod.valueOf("GET"));
3939
assertSame(HttpMethod.POST, HttpMethod.valueOf("POST"));
40+
assertSame(HttpMethod.QUERY, HttpMethod.valueOf("QUERY"));
4041
}
4142

4243
@Test
Collapse file

‎microbench/src/main/java/io/netty/handler/codec/http/HttpMethodMapBenchmark.java‎

Copy file name to clipboardExpand all lines: microbench/src/main/java/io/netty/handler/codec/http/HttpMethodMapBenchmark.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static io.netty.handler.codec.http.HttpMethod.POST;
3838
import static io.netty.handler.codec.http.HttpMethod.PUT;
3939
import static io.netty.handler.codec.http.HttpMethod.TRACE;
40+
import static io.netty.handler.codec.http.HttpMethod.QUERY;
4041
import static io.netty.util.internal.MathUtil.findNextPositivePowerOfTwo;
4142

4243
@State(Scope.Benchmark)
@@ -61,6 +62,7 @@ public class HttpMethodMapBenchmark extends AbstractMicrobenchmark {
6162
"POST",
6263
"PUT",
6364
"PATCH",
65+
"QUERY",
6466
"DELETE",
6567
"TRACE",
6668
"CONNECT"
@@ -98,6 +100,7 @@ public class HttpMethodMapBenchmark extends AbstractMicrobenchmark {
98100
OLD_MAP.put(DELETE.toString(), DELETE);
99101
OLD_MAP.put(TRACE.toString(), TRACE);
100102
OLD_MAP.put(CONNECT.toString(), CONNECT);
103+
OLD_MAP.put(QUERY.toString(), QUERY);
101104

102105
NEW_MAP = new SimpleStringMap<HttpMethod>(
103106
new SimpleStringMap.Node<HttpMethod>(OPTIONS.toString(), OPTIONS),
@@ -106,6 +109,7 @@ public class HttpMethodMapBenchmark extends AbstractMicrobenchmark {
106109
new SimpleStringMap.Node<HttpMethod>(POST.toString(), POST),
107110
new SimpleStringMap.Node<HttpMethod>(PUT.toString(), PUT),
108111
new SimpleStringMap.Node<HttpMethod>(PATCH.toString(), PATCH),
112+
new SimpleStringMap.Node<HttpMethod>(QUERY.toString(), QUERY),
109113
new SimpleStringMap.Node<HttpMethod>(DELETE.toString(), DELETE),
110114
new SimpleStringMap.Node<HttpMethod>(TRACE.toString(), TRACE),
111115
new SimpleStringMap.Node<HttpMethod>(CONNECT.toString(), CONNECT));

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.