From c82d5554d8a8bc316897ab78befbce4adcd42ee5 Mon Sep 17 00:00:00 2001 From: enki Date: Wed, 27 Aug 2025 23:05:07 -0700 Subject: [PATCH] more fucking UI fixes --- internal/api/handlers.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/api/handlers.go b/internal/api/handlers.go index c031692..41cc722 100644 --- a/internal/api/handlers.go +++ b/internal/api/handlers.go @@ -4196,8 +4196,11 @@ func (g *Gateway) calculateWebTorrentPieceLength(fileSize int64) int64 { // getBaseURL returns the base URL for the gateway func (g *Gateway) getBaseURL() string { - // TODO: This should be configurable or detected from request - // For now, use localhost with the configured port + // Use configured public URL if available, otherwise fall back to localhost + if g.publicURL != "" && g.publicURL != "http://localhost" { + return g.publicURL + } + // Fallback to localhost (for development) return fmt.Sprintf("http://localhost:%d", g.config.Gateway.Port) }