MCPcopy
hub / github.com/psf/requests / response_handler

Function response_handler

tests/test_lowlevel.py:370–386  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

368 """
369
370 def response_handler(sock):
371 consume_socket_content(sock, timeout=0.5)
372 sock.send(
373 b'HTTP/1.1 302 FOUND\r\n'
374 b'Content-Length: 0\r\n'
375 b'Location: /get#relevant-section\r\n\r\n'
376 )
377 consume_socket_content(sock, timeout=0.5)
378 sock.send(
379 b'HTTP/1.1 302 FOUND\r\n'
380 b'Content-Length: 0\r\n'
381 b'Location: /final-url/\r\n\r\n'
382 )
383 consume_socket_content(sock, timeout=0.5)
384 sock.send(
385 b'HTTP/1.1 200 OK\r\n\r\n'
386 )
387
388 close_server = threading.Event()
389 server = Server(response_handler, wait_to_close_event=close_server)

Callers

nothing calls this directly

Calls 2

consume_socket_contentFunction · 0.90
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…