Dashboard › opencode › rewriteRequest shared routing
01a0865a-60b7-7569-a149-4964b47af78eChose exported async rewriteRequest(Request, gatewayBase, headers, observer) shared with installFetchInterceptor() over separate routing implementations because bypass, headers, paths, and stream semantics must not drift. The installer must preserve caller shape: Request inputs remain Requests; string/URL inputs remain (url, init) so body and init.headers consumers keep working. It may reuse a pre-parsed gateway URL; the public API remains string-based.