File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " gradio " : patch
3
+ ---
4
+
5
+ feat: Switch from ` root_url ` to ` request.url ` in ` get_api_call_path() `
Original file line number Diff line number Diff line change @@ -384,17 +384,16 @@ def get_api_call_path(request: fastapi.Request) -> str:
384
384
"""
385
385
queue_api_url = f"{ API_PREFIX } /queue/join"
386
386
generic_api_url = f"{ API_PREFIX } /call"
387
+ request_url = str (request .url )
387
388
388
- root_url = get_request_url (request )
389
-
390
- if root_url .endswith (queue_api_url ):
389
+ if request_url .endswith (queue_api_url ):
391
390
return queue_api_url
392
391
393
- start_index = root_url .rfind (generic_api_url )
392
+ start_index = request_url .rfind (generic_api_url )
394
393
if start_index >= 0 :
395
- return root_url [start_index : len (root_url )]
394
+ return request_url [start_index : len (request_url )]
396
395
397
- raise ValueError (f"Request url '{ root_url } ' has an unkown api call pattern." )
396
+ raise ValueError (f"Request url '{ request_url } ' has an unkown api call pattern." )
398
397
399
398
400
399
def get_root_url (
You can’t perform that action at this time.
0 commit comments