mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-21 01:55:21 -04:00
Clarify meaning of sensitive header values (#427)
While the documentation mentions that header values can be marked as sensitive in order to inform outside components that these header values may require special treatment, it was unclear to me whether doing that affects the behavior of this crate. This adds a short note to the documentation to clarify that the main purpose of the sensitivity flag is to make components building on this crate to be aware of sensitive data, such that it can be treated with special care for security purposes.
This commit is contained in:
+8
-3
@@ -304,9 +304,14 @@ impl HeaderValue {
|
||||
/// Returns `true` if the value represents sensitive data.
|
||||
///
|
||||
/// Sensitive data could represent passwords or other data that should not
|
||||
/// be stored on disk or in memory. This setting can be used by components
|
||||
/// like caches to avoid storing the value. HPACK encoders must set the
|
||||
/// header field to never index when `is_sensitive` returns true.
|
||||
/// be stored on disk or in memory. By marking header values as sensitive,
|
||||
/// components using this crate can be instructed to treat them with special
|
||||
/// care for security reasons. For example, caches can avoid storing
|
||||
/// sensitive values, and HPACK encoders used by HTTP/2.0 implementations
|
||||
/// can choose not to compress them.
|
||||
///
|
||||
/// Additionally, sensitive values will be masked by the `Debug`
|
||||
/// implementation of `HeaderValue`.
|
||||
///
|
||||
/// Note that sensitivity is not factored into equality or ordering.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user