Spaces:
Runtime error
Runtime error
Ko-TTS-Arena Contributors commited on
Commit ·
bb088b9
1
Parent(s): c7fb090
Add debug-headers endpoint to check proxy headers
Browse files
app.py
CHANGED
|
@@ -369,6 +369,19 @@ print(f"Loaded {len(all_harvard_sentences)} Korean prompts")
|
|
| 369 |
# Initialize initial_sentences as empty - will be populated with unconsumed sentences only
|
| 370 |
initial_sentences = []
|
| 371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
@app.route("/")
|
| 373 |
def arena():
|
| 374 |
# Pass a subset of sentences for the random button fallback
|
|
|
|
| 369 |
# Initialize initial_sentences as empty - will be populated with unconsumed sentences only
|
| 370 |
initial_sentences = []
|
| 371 |
|
| 372 |
+
@app.route("/debug-headers")
|
| 373 |
+
def debug_headers():
|
| 374 |
+
"""Temporary endpoint to check request headers"""
|
| 375 |
+
headers_info = {
|
| 376 |
+
'X-Forwarded-For': request.headers.get('X-Forwarded-For'),
|
| 377 |
+
'X-Real-IP': request.headers.get('X-Real-IP'),
|
| 378 |
+
'CF-Connecting-IP': request.headers.get('CF-Connecting-IP'),
|
| 379 |
+
'remote_addr': request.remote_addr,
|
| 380 |
+
'access_route': list(request.access_route),
|
| 381 |
+
'get_client_ip()': get_client_ip(),
|
| 382 |
+
}
|
| 383 |
+
return jsonify(headers_info)
|
| 384 |
+
|
| 385 |
@app.route("/")
|
| 386 |
def arena():
|
| 387 |
# Pass a subset of sentences for the random button fallback
|