megatrump commited on
Commit
ab21604
·
verified ·
1 Parent(s): 200c491

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -88,7 +88,8 @@ def proxy(path):
88
  target_path = target_path[1:]
89
 
90
  # For the root path, display the custom warning page.
91
- if not target_path:
 
92
  return INDEX_PAGE_HTML, 200
93
 
94
  # Prepend 'https://' if the scheme is missing.
@@ -140,4 +141,4 @@ def proxy(path):
140
  return "An error occurred while proxying the request.", 502
141
 
142
  if __name__ == '__main__':
143
- app.run(host='0.0.0.0', port=7860)
 
88
  target_path = target_path[1:]
89
 
90
  # For the root path, display the custom warning page.
91
+ # Handle both '' (for a request to '/') and '?' (for a request to '/?').
92
+ if not target_path or target_path == '?':
93
  return INDEX_PAGE_HTML, 200
94
 
95
  # Prepend 'https://' if the scheme is missing.
 
141
  return "An error occurred while proxying the request.", 502
142
 
143
  if __name__ == '__main__':
144
+ app.run(host='0.0.0.0', port=7860)