Skip to content

Commit 8abc3f7

Browse files
jasnellRafaelGSS
authored andcommitted
http: add priority to common http headers
The standard `Priority` header is defined in RFC 9218. This is added as part of the precusor to quic/http3 work. Signed-off-by: James M Snell <[email protected]> PR-URL: #45045 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 2ccc03e commit 8abc3f7

File tree

2 files changed

+57
-55
lines changed

2 files changed

+57
-55
lines changed

src/node_http_common.h

+56-55
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,62 @@ class Environment;
2424
V(PATH, ":path") \
2525
V(PROTOCOL, ":protocol")
2626

27-
#define HTTP_REGULAR_HEADERS(V) \
28-
V(ACCEPT_ENCODING, "accept-encoding") \
29-
V(ACCEPT_LANGUAGE, "accept-language") \
30-
V(ACCEPT_RANGES, "accept-ranges") \
31-
V(ACCEPT, "accept") \
32-
V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \
33-
V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \
34-
V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \
35-
V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \
36-
V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \
37-
V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \
38-
V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \
39-
V(AGE, "age") \
40-
V(AUTHORIZATION, "authorization") \
41-
V(CACHE_CONTROL, "cache-control") \
42-
V(CONNECTION, "connection") \
43-
V(CONTENT_DISPOSITION, "content-disposition") \
44-
V(CONTENT_ENCODING, "content-encoding") \
45-
V(CONTENT_LENGTH, "content-length") \
46-
V(CONTENT_TYPE, "content-type") \
47-
V(COOKIE, "cookie") \
48-
V(DATE, "date") \
49-
V(ETAG, "etag") \
50-
V(FORWARDED, "forwarded") \
51-
V(HOST, "host") \
52-
V(IF_MODIFIED_SINCE, "if-modified-since") \
53-
V(IF_NONE_MATCH, "if-none-match") \
54-
V(IF_RANGE, "if-range") \
55-
V(LAST_MODIFIED, "last-modified") \
56-
V(LINK, "link") \
57-
V(LOCATION, "location") \
58-
V(RANGE, "range") \
59-
V(REFERER, "referer") \
60-
V(SERVER, "server") \
61-
V(SET_COOKIE, "set-cookie") \
62-
V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \
63-
V(TRANSFER_ENCODING, "transfer-encoding") \
64-
V(TE, "te") \
65-
V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \
66-
V(UPGRADE, "upgrade") \
67-
V(USER_AGENT, "user-agent") \
68-
V(VARY, "vary") \
69-
V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \
70-
V(X_FRAME_OPTIONS, "x-frame-options") \
71-
V(KEEP_ALIVE, "keep-alive") \
72-
V(PROXY_CONNECTION, "proxy-connection") \
73-
V(X_XSS_PROTECTION, "x-xss-protection") \
74-
V(ALT_SVC, "alt-svc") \
75-
V(CONTENT_SECURITY_POLICY, "content-security-policy") \
76-
V(EARLY_DATA, "early-data") \
77-
V(EXPECT_CT, "expect-ct") \
78-
V(ORIGIN, "origin") \
79-
V(PURPOSE, "purpose") \
80-
V(TIMING_ALLOW_ORIGIN, "timing-allow-origin") \
81-
V(X_FORWARDED_FOR, "x-forwarded-for")
27+
#define HTTP_REGULAR_HEADERS(V) \
28+
V(ACCEPT_ENCODING, "accept-encoding") \
29+
V(ACCEPT_LANGUAGE, "accept-language") \
30+
V(ACCEPT_RANGES, "accept-ranges") \
31+
V(ACCEPT, "accept") \
32+
V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \
33+
V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \
34+
V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \
35+
V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \
36+
V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \
37+
V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \
38+
V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \
39+
V(AGE, "age") \
40+
V(AUTHORIZATION, "authorization") \
41+
V(CACHE_CONTROL, "cache-control") \
42+
V(CONNECTION, "connection") \
43+
V(CONTENT_DISPOSITION, "content-disposition") \
44+
V(CONTENT_ENCODING, "content-encoding") \
45+
V(CONTENT_LENGTH, "content-length") \
46+
V(CONTENT_TYPE, "content-type") \
47+
V(COOKIE, "cookie") \
48+
V(DATE, "date") \
49+
V(ETAG, "etag") \
50+
V(FORWARDED, "forwarded") \
51+
V(HOST, "host") \
52+
V(IF_MODIFIED_SINCE, "if-modified-since") \
53+
V(IF_NONE_MATCH, "if-none-match") \
54+
V(IF_RANGE, "if-range") \
55+
V(LAST_MODIFIED, "last-modified") \
56+
V(LINK, "link") \
57+
V(LOCATION, "location") \
58+
V(RANGE, "range") \
59+
V(REFERER, "referer") \
60+
V(SERVER, "server") \
61+
V(SET_COOKIE, "set-cookie") \
62+
V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \
63+
V(TRANSFER_ENCODING, "transfer-encoding") \
64+
V(TE, "te") \
65+
V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \
66+
V(UPGRADE, "upgrade") \
67+
V(USER_AGENT, "user-agent") \
68+
V(VARY, "vary") \
69+
V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \
70+
V(X_FRAME_OPTIONS, "x-frame-options") \
71+
V(KEEP_ALIVE, "keep-alive") \
72+
V(PROXY_CONNECTION, "proxy-connection") \
73+
V(X_XSS_PROTECTION, "x-xss-protection") \
74+
V(ALT_SVC, "alt-svc") \
75+
V(CONTENT_SECURITY_POLICY, "content-security-policy") \
76+
V(EARLY_DATA, "early-data") \
77+
V(EXPECT_CT, "expect-ct") \
78+
V(ORIGIN, "origin") \
79+
V(PURPOSE, "purpose") \
80+
V(TIMING_ALLOW_ORIGIN, "timing-allow-origin") \
81+
V(X_FORWARDED_FOR, "x-forwarded-for") \
82+
V(PRIORITY, "priority")
8283

8384
#define HTTP_ADDITIONAL_HEADERS(V) \
8485
V(ACCEPT_CHARSET, "accept-charset") \

test/parallel/test-http2-binding.js

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ const expectedHeaderNames = {
180180
HTTP2_HEADER_PURPOSE: 'purpose',
181181
HTTP2_HEADER_TIMING_ALLOW_ORIGIN: 'timing-allow-origin',
182182
HTTP2_HEADER_X_FORWARDED_FOR: 'x-forwarded-for',
183+
HTTP2_HEADER_PRIORITY: 'priority',
183184
};
184185

185186
const expectedNGConstants = {

0 commit comments

Comments
 (0)