mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-28 00:24:19 +00:00
ec45d3491a
* fix: derive JSON/Clash subscription URLs from configured subURI When subURI is explicitly configured (reverse-proxy setup) but subJsonURI or subClashURI are not, BuildSubURIBase generates URLs with the raw sub- server port (2096) and the wrong scheme (http), producing broken links on the subscription page (e.g. http://domain:2096/json/SUB_ID). Fix: in BuildURLs, when subURI is set, extract its scheme+host and use that as the base for all unconfigured sibling URLs instead of calling BuildSubURIBase. This ensures JSON and Clash Copy URLs match the reverse- proxy endpoint. Fixes: JSON/Clash subscription URLs shown on the subscription info page now correctly inherit the configured subURI's scheme and host. * fix(sub): fall back to request base when configured subURI is unparseable Harden the JSON/Clash URL derivation added for the reverse-proxy fix: extractBaseFromURI now returns "" when the configured subURI has no scheme/host, and BuildURLs falls back to the request-derived base in that case instead of emitting a broken value (e.g. ":///json/ABC"). Add a regression test covering a scheme-less subURI. --------- Co-authored-by: w3struk <w3struk@gmail.com> Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>