aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoogle Java Core Libraries <java-team-github-bot@google.com>2021-09-22 12:40:59 -0700
committerGoogle Java Core Libraries <java-core-libraries-team+copybara@google.com>2021-09-22 12:43:40 -0700
commit4beff962f36846fbfc8ff1de89f0a63716ad45d2 (patch)
tree959a38ff5879e905b5407a93cd91720be79df4ff
parent920416b3ed43bc360dd446ea58158048c0b5d80e (diff)
downloadguava-4beff962f36846fbfc8ff1de89f0a63716ad45d2.tar.gz
Add `HttpHeaders` constants for Accept-CH, Client-CH, Sec-CH-UA-Reduced, Device-Memory, Downlink, ECT, RTT, Save-Data, Viewport-Width, Width, and Permissions-Policy.
RELNOTES=n/a PiperOrigin-RevId: 398305066
-rw-r--r--android/guava-tests/test/com/google/common/net/HttpHeadersTest.java4
-rw-r--r--android/guava/src/com/google/common/net/HttpHeaders.java83
-rw-r--r--guava-tests/test/com/google/common/net/HttpHeadersTest.java4
-rw-r--r--guava/src/com/google/common/net/HttpHeaders.java83
4 files changed, 170 insertions, 4 deletions
diff --git a/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java b/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java
index 9927e6b94..5361b3fce 100644
--- a/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java
+++ b/android/guava-tests/test/com/google/common/net/HttpHeadersTest.java
@@ -50,8 +50,8 @@ public class HttpHeadersTest extends TestCase {
.build();
ImmutableSet<String> uppercaseAcronyms =
ImmutableSet.of(
- "CH", "ID", "DNT", "DNS", "HTTP2", "IP", "MD5", "P3P", "TE", "UA", "UID", "URL", "WWW",
- "XSS");
+ "CH", "ID", "DNT", "DNS", "ECT", "HTTP2", "IP", "MD5", "P3P", "RTT", "TE", "UA", "UID",
+ "URL", "WWW", "XSS");
assertConstantNameMatchesString(HttpHeaders.class, specialCases, uppercaseAcronyms);
}
diff --git a/android/guava/src/com/google/common/net/HttpHeaders.java b/android/guava/src/com/google/common/net/HttpHeaders.java
index 64469b47a..2363a1890 100644
--- a/android/guava/src/com/google/common/net/HttpHeaders.java
+++ b/android/guava/src/com/google/common/net/HttpHeaders.java
@@ -534,6 +534,72 @@ public final class HttpHeaders {
/**
* The HTTP <a
+ * href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Device-Memory">{@code
+ * Device-Memory}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String DEVICE_MEMORY = "Device-Memory";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink">{@code
+ * Downlink}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String DOWNLINK = "Downlink";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT">{@code
+ * ECT}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String ECT = "ECT";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT">{@code
+ * RTT}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String RTT = "RTT";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data">{@code
+ * Save-Data}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String SAVE_DATA = "Save-Data";
+
+ /**
+ * The HTTP <a
+ * href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Viewport-Width">{@code
+ * Viewport-Width}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String VIEWPORT_WIDTH = "Viewport-Width";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Width">{@code
+ * Width}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String WIDTH = "Width";
+
+ /**
+ * The HTTP <a href="https://www.w3.org/TR/permissions-policy-1/">{@code Permissions-Policy}</a>
+ * header field name.
+ *
+ * @since NEXT
+ */
+ public static final String PERMISSIONS_POLICY = "Permissions-Policy";
+
+ /**
+ * The HTTP <a
* href="https://wicg.github.io/user-preference-media-features-headers/#sec-ch-prefers-color-scheme">{@code
* Sec-CH-Prefers-Color-Scheme}</a> header field name.
*
@@ -544,6 +610,23 @@ public final class HttpHeaders {
public static final String SEC_CH_PREFERS_COLOR_SCHEME = "Sec-CH-Prefers-Color-Scheme";
/**
+ * The HTTP <a
+ * href="https://www.rfc-editor.org/rfc/rfc8942#name-the-accept-ch-response-head">{@code
+ * Accept-CH}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String ACCEPT_CH = "Accept-CH";
+ /**
+ * The HTTP <a
+ * href="https://datatracker.ietf.org/doc/html/draft-davidben-http-client-hint-reliability-03.txt#section-3">{@code
+ * Critical-CH}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String CRITICAL_CH = "Critical-CH";
+
+ /**
* The HTTP <a href="https://wicg.github.io/ua-client-hints/#sec-ch-ua">{@code Sec-CH-UA}</a>
* header field name.
*
diff --git a/guava-tests/test/com/google/common/net/HttpHeadersTest.java b/guava-tests/test/com/google/common/net/HttpHeadersTest.java
index 9927e6b94..5361b3fce 100644
--- a/guava-tests/test/com/google/common/net/HttpHeadersTest.java
+++ b/guava-tests/test/com/google/common/net/HttpHeadersTest.java
@@ -50,8 +50,8 @@ public class HttpHeadersTest extends TestCase {
.build();
ImmutableSet<String> uppercaseAcronyms =
ImmutableSet.of(
- "CH", "ID", "DNT", "DNS", "HTTP2", "IP", "MD5", "P3P", "TE", "UA", "UID", "URL", "WWW",
- "XSS");
+ "CH", "ID", "DNT", "DNS", "ECT", "HTTP2", "IP", "MD5", "P3P", "RTT", "TE", "UA", "UID",
+ "URL", "WWW", "XSS");
assertConstantNameMatchesString(HttpHeaders.class, specialCases, uppercaseAcronyms);
}
diff --git a/guava/src/com/google/common/net/HttpHeaders.java b/guava/src/com/google/common/net/HttpHeaders.java
index 64469b47a..2363a1890 100644
--- a/guava/src/com/google/common/net/HttpHeaders.java
+++ b/guava/src/com/google/common/net/HttpHeaders.java
@@ -534,6 +534,72 @@ public final class HttpHeaders {
/**
* The HTTP <a
+ * href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Device-Memory">{@code
+ * Device-Memory}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String DEVICE_MEMORY = "Device-Memory";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink">{@code
+ * Downlink}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String DOWNLINK = "Downlink";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT">{@code
+ * ECT}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String ECT = "ECT";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT">{@code
+ * RTT}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String RTT = "RTT";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data">{@code
+ * Save-Data}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String SAVE_DATA = "Save-Data";
+
+ /**
+ * The HTTP <a
+ * href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Viewport-Width">{@code
+ * Viewport-Width}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String VIEWPORT_WIDTH = "Viewport-Width";
+
+ /**
+ * The HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Width">{@code
+ * Width}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String WIDTH = "Width";
+
+ /**
+ * The HTTP <a href="https://www.w3.org/TR/permissions-policy-1/">{@code Permissions-Policy}</a>
+ * header field name.
+ *
+ * @since NEXT
+ */
+ public static final String PERMISSIONS_POLICY = "Permissions-Policy";
+
+ /**
+ * The HTTP <a
* href="https://wicg.github.io/user-preference-media-features-headers/#sec-ch-prefers-color-scheme">{@code
* Sec-CH-Prefers-Color-Scheme}</a> header field name.
*
@@ -544,6 +610,23 @@ public final class HttpHeaders {
public static final String SEC_CH_PREFERS_COLOR_SCHEME = "Sec-CH-Prefers-Color-Scheme";
/**
+ * The HTTP <a
+ * href="https://www.rfc-editor.org/rfc/rfc8942#name-the-accept-ch-response-head">{@code
+ * Accept-CH}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String ACCEPT_CH = "Accept-CH";
+ /**
+ * The HTTP <a
+ * href="https://datatracker.ietf.org/doc/html/draft-davidben-http-client-hint-reliability-03.txt#section-3">{@code
+ * Critical-CH}</a> header field name.
+ *
+ * @since NEXT
+ */
+ public static final String CRITICAL_CH = "Critical-CH";
+
+ /**
* The HTTP <a href="https://wicg.github.io/ua-client-hints/#sec-ch-ua">{@code Sec-CH-UA}</a>
* header field name.
*