diff --git a/b0esche_cloud/lib/main.dart b/b0esche_cloud/lib/main.dart index 828abb3..8f9bf8a 100644 --- a/b0esche_cloud/lib/main.dart +++ b/b0esche_cloud/lib/main.dart @@ -16,7 +16,11 @@ import 'pages/public_file_viewer.dart'; import 'theme/app_theme.dart'; import 'injection.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:web/web.dart' as web; + final GoRouter _router = GoRouter( + initialLocation: kIsWeb ? web.window.location.pathname + web.window.location.search : '/', routes: [ GoRoute(path: '/', builder: (context, state) => const HomePage()), GoRoute( diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index 4f71f5a..101e15f 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -2922,10 +2922,7 @@ func publicFileShareHandler(w http.ResponseWriter, r *http.Request, db *database } else if r.TLS == nil { scheme = "http" } - host := r.Host - if host == "" { - host = "go.b0esche.cloud" - } + host := "www.b0esche.cloud" downloadPath := fmt.Sprintf("%s://%s/public/share/%s/download?token=%s", scheme, host, token, url.QueryEscape(viewerToken)) // Determine file type