Skip to content

Commit 703a0cc

Browse files
committed
feat(header): Add Prefer and Preference-Applied headers
See also: https://http.dev/prefer https://http.dev/preference-applied
1 parent 6e2dd42 commit 703a0cc

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/header/name.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,28 @@ standard_headers! {
737737
/// Cache-Control HTTP/1.1 header is not yet present.
738738
(Pragma, PRAGMA, b"pragma");
739739

740+
/// Influencing how a server processes a request without changing its
741+
/// semantics is achieved through the Prefer request header, which
742+
/// communicates optional processing preferences.
743+
///
744+
/// The Prefer header enables clients to express preferences about how a
745+
/// server processes a request and constructs a response. Preferences are
746+
/// advisory. A server is free to ignore any or all preferences without
747+
/// causing the request to fail. When a server honors one or more
748+
/// preferences, the Preference-Applied response header confirms which ones
749+
/// were applied.
750+
(Prefer, PREFER, b"prefer");
751+
752+
/// When a server honors optional behaviors from the Prefer request header,
753+
/// the Preference-Applied response header confirms which preferences were
754+
/// applied during processing.
755+
///
756+
/// The Preference-Applied header is part of the HTTP Prefer framework.
757+
/// Clients use the Prefer request header to request optional behaviors
758+
/// during request processing. The server responds with Preference-Applied
759+
/// to confirm which preferences were applied.
760+
(PreferenceApplied, PREFERENCE_APPLIED, b"preference-applied");
761+
740762
/// Defines the authentication method that should be used to gain access to
741763
/// a proxy.
742764
///

0 commit comments

Comments
 (0)