Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <jasnell@gmail.com>
  • Loading branch information
jasnell committed Oct 19, 2022
commit 7f311d93e9b77388514e9e5d747246566b8a5d98
111 changes: 56 additions & 55 deletions src/node_http_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,61 +24,62 @@ class Environment;
V(PATH, ":path") \
V(PROTOCOL, ":protocol")

#define HTTP_REGULAR_HEADERS(V) \
V(ACCEPT_ENCODING, "accept-encoding") \
V(ACCEPT_LANGUAGE, "accept-language") \
V(ACCEPT_RANGES, "accept-ranges") \
V(ACCEPT, "accept") \
V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \
V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \
V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \
V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \
V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \
V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \
V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \
V(AGE, "age") \
V(AUTHORIZATION, "authorization") \
V(CACHE_CONTROL, "cache-control") \
V(CONNECTION, "connection") \
V(CONTENT_DISPOSITION, "content-disposition") \
V(CONTENT_ENCODING, "content-encoding") \
V(CONTENT_LENGTH, "content-length") \
V(CONTENT_TYPE, "content-type") \
V(COOKIE, "cookie") \
V(DATE, "date") \
V(ETAG, "etag") \
V(FORWARDED, "forwarded") \
V(HOST, "host") \
V(IF_MODIFIED_SINCE, "if-modified-since") \
V(IF_NONE_MATCH, "if-none-match") \
V(IF_RANGE, "if-range") \
V(LAST_MODIFIED, "last-modified") \
V(LINK, "link") \
V(LOCATION, "location") \
V(RANGE, "range") \
V(REFERER, "referer") \
V(SERVER, "server") \
V(SET_COOKIE, "set-cookie") \
V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \
V(TRANSFER_ENCODING, "transfer-encoding") \
V(TE, "te") \
V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \
V(UPGRADE, "upgrade") \
V(USER_AGENT, "user-agent") \
V(VARY, "vary") \
V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \
V(X_FRAME_OPTIONS, "x-frame-options") \
V(KEEP_ALIVE, "keep-alive") \
V(PROXY_CONNECTION, "proxy-connection") \
V(X_XSS_PROTECTION, "x-xss-protection") \
V(ALT_SVC, "alt-svc") \
V(CONTENT_SECURITY_POLICY, "content-security-policy") \
V(EARLY_DATA, "early-data") \
V(EXPECT_CT, "expect-ct") \
V(ORIGIN, "origin") \
V(PURPOSE, "purpose") \
V(TIMING_ALLOW_ORIGIN, "timing-allow-origin") \
V(X_FORWARDED_FOR, "x-forwarded-for")
#define HTTP_REGULAR_HEADERS(V) \
V(ACCEPT_ENCODING, "accept-encoding") \
V(ACCEPT_LANGUAGE, "accept-language") \
V(ACCEPT_RANGES, "accept-ranges") \
V(ACCEPT, "accept") \
V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \
V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \
V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \
V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \
V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \
V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \
V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \
V(AGE, "age") \
V(AUTHORIZATION, "authorization") \
V(CACHE_CONTROL, "cache-control") \
V(CONNECTION, "connection") \
V(CONTENT_DISPOSITION, "content-disposition") \
V(CONTENT_ENCODING, "content-encoding") \
V(CONTENT_LENGTH, "content-length") \
V(CONTENT_TYPE, "content-type") \
V(COOKIE, "cookie") \
V(DATE, "date") \
V(ETAG, "etag") \
V(FORWARDED, "forwarded") \
V(HOST, "host") \
V(IF_MODIFIED_SINCE, "if-modified-since") \
V(IF_NONE_MATCH, "if-none-match") \
V(IF_RANGE, "if-range") \
V(LAST_MODIFIED, "last-modified") \
V(LINK, "link") \
V(LOCATION, "location") \
V(RANGE, "range") \
V(REFERER, "referer") \
V(SERVER, "server") \
V(SET_COOKIE, "set-cookie") \
V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \
V(TRANSFER_ENCODING, "transfer-encoding") \
V(TE, "te") \
V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \
V(UPGRADE, "upgrade") \
V(USER_AGENT, "user-agent") \
V(VARY, "vary") \
V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \
V(X_FRAME_OPTIONS, "x-frame-options") \
V(KEEP_ALIVE, "keep-alive") \
V(PROXY_CONNECTION, "proxy-connection") \
V(X_XSS_PROTECTION, "x-xss-protection") \
V(ALT_SVC, "alt-svc") \
V(CONTENT_SECURITY_POLICY, "content-security-policy") \
V(EARLY_DATA, "early-data") \
V(EXPECT_CT, "expect-ct") \
V(ORIGIN, "origin") \
V(PURPOSE, "purpose") \
V(TIMING_ALLOW_ORIGIN, "timing-allow-origin") \
V(X_FORWARDED_FOR, "x-forwarded-for") \
V(PRIORITY, "priority")
Comment thread
jasnell marked this conversation as resolved.

#define HTTP_ADDITIONAL_HEADERS(V) \
V(ACCEPT_CHARSET, "accept-charset") \
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-http2-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const expectedHeaderNames = {
HTTP2_HEADER_PURPOSE: 'purpose',
HTTP2_HEADER_TIMING_ALLOW_ORIGIN: 'timing-allow-origin',
HTTP2_HEADER_X_FORWARDED_FOR: 'x-forwarded-for',
HTTP2_HEADER_PRIORITY: 'priority',
};

const expectedNGConstants = {
Expand Down