Spaces:
Sleeping
Sleeping
bug fix
Browse files
app.py
CHANGED
|
@@ -5,11 +5,11 @@ def echo(text, request: gr.Request):
|
|
| 5 |
output_text = json.dumps({"text": text})
|
| 6 |
if request:
|
| 7 |
print("Request headers dictionary:", request.headers)
|
| 8 |
-
output_text
|
| 9 |
print("IP address:", request.client.host)
|
| 10 |
-
output_text
|
| 11 |
print("Query parameters:", dict(request.query_params))
|
| 12 |
-
output_text
|
| 13 |
return output_text
|
| 14 |
|
| 15 |
io = gr.Interface(echo, "textbox", "json").launch(share=True)
|
|
|
|
| 5 |
output_text = json.dumps({"text": text})
|
| 6 |
if request:
|
| 7 |
print("Request headers dictionary:", request.headers)
|
| 8 |
+
output_text.add({"headers": dict(request.headers)})
|
| 9 |
print("IP address:", request.client.host)
|
| 10 |
+
output_text.add({"headers": dict(request.headers)})
|
| 11 |
print("Query parameters:", dict(request.query_params))
|
| 12 |
+
output_text.add({"query_params": dict(request.query_params)})
|
| 13 |
return output_text
|
| 14 |
|
| 15 |
io = gr.Interface(echo, "textbox", "json").launch(share=True)
|