X-Forwarded-Host packs path + Proto defaults to https; breaks editor on non-mycelium clients #16
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_office#16
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
When the editor wrapper is loaded via any non-mycelium path (mac via SSH tunnel, public IP, etc), OnlyOffice's runtime fetches for
Editor.bincome back fromhttps://<host>:9988/hero%5foffice/ui/onlyoffice/cache/files/data/<key>/Editor.bin. Two defects in the URL:https://(page is HTTP)%5f(URL-encoded underscore)Browser tries the URL →
ERR_SSL_PROTOCOL_ERRORagainst an HTTP-only stack → editor renders shell but document body never loads.Cause
crates/hero_office_ui/src/handlers.rs::forward_to_onlyoffice(lines ~864–875) packs a path intoX-Forwarded-Hostand defaultsX-Forwarded-Prototohttps:OnlyOffice URL-encodes
oo_externalwhen embedding it in cache URLs (treating it as a host). The_becomes%5f. The default-https is also wrong for any HTTP-only deployment.Why it didn't surface earlier
Acceptance
X-Forwarded-Hostonly contains host:port (no path).X-Forwarded-Prefix: /hero_office/ui/onlyofficecarries the path.X-Forwarded-Protodefaults tohttpwhen the original incoming request is plain HTTP (orhero_routersets it explicitly).X-Forwarded-Prefixfor cache URL generation. May require alocal.jsonoverride baked into the docker container orservice_onlyoffice.nu.Editor.binfetches succeed and the document body renders.