@@ -407,14 +407,28 @@ def test_custom_debug_logging_handler(self):
407
407
408
408
409
409
class ServerWithSelfSingedSSL (http .server .SimpleHTTPRequestHandler ):
410
- def _set_headers (self ):
411
- self .send_response (200 )
412
- self .send_header ('Content-type' , 'application/json' )
410
+ def _set_headers (self , response : bytes ):
411
+ self .send_response (http .HTTPStatus .OK )
412
+ self .send_header ("Content-type" , 'application/json' )
413
+ self .send_header ("Content-Length" , f'{ len (response )} ' )
414
+ self .send_header ("Last-Modified" , self .date_time_string ())
413
415
self .end_headers ()
414
416
415
417
def do_GET (self ):
416
- self ._set_headers ()
417
418
response = json .dumps (
418
419
dict (name = "influxdb" , message = "ready for queries and writes" , status = "pass" , checks = [], version = "2.0.0" ,
419
420
commit = "abcdefgh" )).encode ('utf-8' )
421
+ self ._set_headers (response )
420
422
self .wfile .write (response )
423
+
424
+
425
+ # def do_GET(self):
426
+ # response = json.dumps(
427
+ # dict(name="influxdb", message="ready for queries and writes", status="pass", checks=[], version="2.0.0",
428
+ # commit="abcdefgh")).encode('utf-8')
429
+ # self.send_response(http.HTTPStatus.OK)
430
+ # self.send_header("Content-type", 'application/json')
431
+ # self.send_header("Content-Length", f'{len(response)}')
432
+ # self.send_header("Last-Modified", self.date_time_string())
433
+ # self.end_headers()
434
+ # self.wfile.write(response)
0 commit comments