mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
fix(ssl): strip trailing slash in getBaseUrl + trust OS certificate store for HTTPS streaming
Fixes two bugs reported in #178: - getBaseUrl() now strips trailing slashes from server URLs, consistent with restBaseFromUrl(). A trailing slash caused double-slash stream URLs (//rest/stream.view) which Caddy rejects. Trailing slash also caused browsing to return 0 results. Fix manually ported from PR #179 by kveld9. - reqwest now loads the OS native certificate store in addition to Mozilla's webpki roots (rustls-tls-native-roots feature). Fixes HTTPS streaming failures where the server certificate is signed by a local CA (e.g. Caddy internal CA) that is trusted in the system keychain but not in Mozilla's root store. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -546,7 +546,8 @@ export const useAuthStore = create<AuthState>()(
|
||||
const s = get();
|
||||
const server = s.servers.find(srv => srv.id === s.activeServerId);
|
||||
if (!server?.url) return '';
|
||||
return server.url.startsWith('http') ? server.url : `http://${server.url}`;
|
||||
const base = server.url.startsWith('http') ? server.url : `http://${server.url}`;
|
||||
return base.replace(/\/$/, '');
|
||||
},
|
||||
|
||||
getActiveServer: () => {
|
||||
|
||||
Reference in New Issue
Block a user