Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,13 +16,14 @@ def handle_request(path=""):
|
|
| 16 |
data = request.data
|
| 17 |
params = request.args
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
| 26 |
|
| 27 |
# Create a response with the content received from the new URL
|
| 28 |
proxied_response = Response(response.content)
|
|
|
|
| 16 |
data = request.data
|
| 17 |
params = request.args
|
| 18 |
|
| 19 |
+
headers = None
|
| 20 |
+
|
| 21 |
+
# If the request is a POST request, set the Content-Type header to application/json
|
| 22 |
+
if method == 'POST':
|
| 23 |
+
headers = {'Content-Type': 'application/json'}
|
| 24 |
+
|
| 25 |
+
# Make a request to the new URL with the provided method, data, params, and headers
|
| 26 |
+
response = requests.request(method, chat_ui_url, params=params, data=data, headers=headers)
|
| 27 |
|
| 28 |
# Create a response with the content received from the new URL
|
| 29 |
proxied_response = Response(response.content)
|