Commit Graph
1 Commits
Author SHA1 Message Date
Lauri Ojansivu bb4c892254 Gate the REST API as Express routes it, and keep impersonation status private.
With WITH_API off, the API gate refused req.url.startsWith('/api') - but
Express matches routes case-insensitively and on the decoded path, so /API/...
and /%61pi/... reached every API handler anyway. The gate now decides the
same way. The test covers the spellings Express routes and those it must not.

The isImpersonated method answered for any user id, to anyone, signed in or
not; it now answers only about the caller, or to a site admin.

Thanks to xet7 !
2026-10-02 11:22:54 +03:00