File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ use crate::{
4545
4646pub ( crate ) static ENROLLMENT_COOKIE_NAME : & str = "defguard_proxy" ;
4747pub ( crate ) static PASSWORD_RESET_COOKIE_NAME : & str = "defguard_proxy_password_reset" ;
48+ const DEFGUARD_CORE_CONNECTED_HEADER : & str = "defguard-core-connected" ;
4849const DEFGUARD_CORE_VERSION_HEADER : & str = "defguard-core-version" ;
4950const RATE_LIMITER_CLEANUP_PERIOD : Duration = Duration :: from_secs ( 60 ) ;
5051const X_FORWARDED_FOR : & str = "x-forwarded-for" ;
@@ -143,6 +144,17 @@ async fn core_version_middleware(
143144 }
144145 }
145146
147+ let core_connected = app_state. grpc_server . connected . load ( Ordering :: Relaxed ) ;
148+ let core_connected_header = if core_connected {
149+ HeaderValue :: from_static ( "true" )
150+ } else {
151+ HeaderValue :: from_static ( "false" )
152+ } ;
153+
154+ response
155+ . headers_mut ( )
156+ . insert ( DEFGUARD_CORE_CONNECTED_HEADER , core_connected_header) ;
157+
146158 response
147159}
148160
You can’t perform that action at this time.
0 commit comments