fix(router): preserve percent-encoding in forward_path #61
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_router#61
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
Any request whose path contains percent-encoded characters (e.g.
%20) panics a hero_router worker thread, and the client seesEmpty reply from server(curl exit 52). Reproduces on any 3-segment proxy URL with non-ASCII / encoded chars.Root cause
service_proxy_pathatcrates/hero_router/src/server/routes.rs:985extracts the trailing path with axum'sPath<(String, String, String)>— which percent-decodes the segment. SoData%20…becomesData Mining…(raw spaces). The decoded form is then passed toUnixUri::new(socket, &forward_uri)which panics in hyper's URI parser because raw spaces are not valid URI characters.Acceptance
/hero_office/ui/pdf/edit/Data%20Mining%20Lab%20Two-1.pdf?context=geomindreturns 200 (or the upstream's real response).InvalidUriCharpanics inhero_proc service logs hero_router.