fix(foundry): URL-decode path segments in files_api #19
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_foundry#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Files uploaded with non-ASCII characters in the name (e.g. spaces) get stored on disk with their percent-encoded form, then can't be read back with the same URL.
Root cause
crates/hero_foundry_server/src/http/files_api.rs:36-58(handle_files_api) readsreq.uri().path()and uses the raw segment as the literal filename. Percent-encoding is never decoded. So callers that follow the standardurlencode(filename)convention (e.g.hero_office_server::socket_dav::put_file) end up storing files with their encoded names.Acceptance
/api/files/{ctx}/{name with spaces}round-trips correctly.Hello World.pdf, notHello%20World.pdf).Hello.pdf).