File endpoints: use query parameters for NGINX/Caddy compatibility #6376
+137
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
When deploying ComfyUI behind
NGINX
, we encountered issues with file-related endpoints due to the use of path parameters for file paths. Proxy servers may modify the encoding of URLs, leading to inconsistent behavior. For example:http://127.0.0.1:8188/api/userdata/workflows%2Fphoto_stickers2.json?overwrite=false&full_info=true
NGINX
may decode it to:http://127.0.0.1:8188/api/userdata/workflows/photo_stickers2.json?overwrite=false&full_info=true
This inconsistency caused the ComfyUI server to respond with a
405 Method Not Allowed
status.Changes Made:
getuserdata
,post_userdata
,delete_userdata
, andmove_userdata
) to use query parameters instead of path parameters for file paths. This ensures compatibility with proxy servers by avoiding reliance on URL path encoding.move_userdata
endpoint, both the source and destination paths are now passed as query parameters (source
anddest
).Notes:
This PR replaces old PR #6363 which was only a workaround which we applied on server to temporary make ComfyUI work.
Resolves: #5629
Partially fixes problem from #4534