Skip to content

Commit 3b7b699

Browse files
authored
Merge pull request #11400 from LawnGnome/for-real-get-rid-of-cookies
sentry: also remove the `Cookie` header
2 parents 010cce1 + 3626451 commit 3b7b699

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sentry/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::config::SentryConfig;
2-
use http::header::AUTHORIZATION;
2+
use http::header::{AUTHORIZATION, COOKIE};
33
use sentry::protocol::Event;
44
use sentry::{ClientInitGuard, ClientOptions, TransactionContext};
55
use std::sync::Arc;
@@ -67,7 +67,7 @@ fn options(config: SentryConfig) -> ClientOptions {
6767
// they're redacting it downstream.
6868
request
6969
.headers
70-
.retain(|name, _value| AUTHORIZATION != name.as_str());
70+
.retain(|name, _value| AUTHORIZATION != name.as_str() && COOKIE != name.as_str());
7171
}
7272

7373
Some(event)
@@ -106,6 +106,7 @@ mod tests {
106106
("Authorization", "secret"),
107107
("authorization", "another secret"),
108108
("Accept", "application/json"),
109+
("Cookie", "cargo_session=foobar"),
109110
]
110111
.into_iter()
111112
.map(|(k, v)| (k.to_string(), v.to_string()))

0 commit comments

Comments
 (0)