Fix share link routing: add initialLocation to GoRouter and fix download URL host

This commit is contained in:
Leon Bösche
2026-01-25 00:34:16 +01:00
parent f44d64b7ad
commit db331ef4ca
2 changed files with 5 additions and 4 deletions

View File

@@ -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(

View File

@@ -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