File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -237,14 +237,16 @@ async def websocket_to_stdout(websocket: ClientConnection,
237237 # TODO(aylei): Remove this after 0.10.0
238238 server_url = f'http://{ server_url } '
239239
240- health_url = f'{ server_url } /api/health'
241- health_response = requests .get (health_url )
242- health_data = health_response .json ()
243- timestamps_are_supported = int (health_data ['api_version' ]) > 21
244240 disable_latency_measurement = os .environ .get (
245241 skylet_constants .SSH_DISABLE_LATENCY_MEASUREMENT_ENV_VAR , '0' ) == '1'
246- timestamps_are_supported = (timestamps_are_supported and
247- not disable_latency_measurement )
242+ if disable_latency_measurement :
243+ timestamps_are_supported = False
244+ else :
245+ health_url = f'{ server_url } /api/health'
246+ cookie_hdr = _get_cookie_header (health_url )
247+ health_response = requests .get (health_url , headers = cookie_hdr )
248+ health_data = health_response .json ()
249+ timestamps_are_supported = int (health_data .get ('api_version' , 0 )) > 21
248250
249251 server_proto , server_fqdn = server_url .split ('://' )
250252 websocket_proto = 'ws'
You can’t perform that action at this time.
0 commit comments