diff --git a/proxy/rewriter.go b/proxy/rewriter.go index 69e7228..891f71a 100644 --- a/proxy/rewriter.go +++ b/proxy/rewriter.go @@ -134,12 +134,10 @@ func (r *ContentRewriter) rewriteURL(urlStr string) string { u = r.baseURL.ResolveReference(u) } - proxyPath := u.Path - if u.RawQuery != "" { - proxyPath += "?" + u.RawQuery - } + // 保留完整的 URL(包括域名) + fullURL := u.String() - return "/p/" + r.token + proxyPath + return "/p/" + r.token + "/" + fullURL } func (r *ContentRewriter) rewriteSrcset(srcset string) string {