mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
http-cache: do not cache responses from requests with authorization
This commit is contained in:
parent
049817c5a7
commit
67494d4776
1 changed files with 9 additions and 0 deletions
|
@ -802,6 +802,15 @@ impl HttpCache {
|
|||
// Only Get requests are cached.
|
||||
return;
|
||||
}
|
||||
if request.headers.contains_key(header::AUTHORIZATION) {
|
||||
// https://tools.ietf.org/html/rfc7234#section-3.1
|
||||
// A shared cache MUST NOT use a cached response
|
||||
// to a request with an Authorization header field
|
||||
//
|
||||
// TODO: unless a cache directive that allows such
|
||||
// responses to be stored is present in the response.
|
||||
return;
|
||||
};
|
||||
let entry_key = CacheKey::new(request.clone());
|
||||
let metadata = match response.metadata() {
|
||||
Ok(FetchMetadata::Filtered {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue