Added 'allow_redirects' parameter in perform_request function for RequestsHttpConnection (#401)

Signed-off-by: saimedhi <[email protected]>
This commit is contained in:
Sai Medhini Reddy Maryada
2023-06-13 15:15:00 -04:00
committed by GitHub
parent 237ce9daf6
commit f1b5706ebd
4 changed files with 63 additions and 4 deletions
+9 -2
View File
@@ -14,9 +14,16 @@ from http.server import BaseHTTPRequestHandler, HTTPServer
class TestHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
headers = self.headers
self.send_header("Content-type", "application/json")
if self.path == "/redirect":
new_location = "http://localhost:8090"
self.send_response(302)
self.send_header("Location", new_location)
else:
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
Headers = {}