File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11use crate :: config:: SentryConfig ;
2- use http:: header:: AUTHORIZATION ;
2+ use http:: header:: { AUTHORIZATION , COOKIE } ;
33use sentry:: protocol:: Event ;
44use sentry:: { ClientInitGuard , ClientOptions , TransactionContext } ;
55use 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 ( ) ) )
You can’t perform that action at this time.
0 commit comments