Fix share link routing: add initialLocation to GoRouter and fix download URL host
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user