From 34073582073ece92cfa323fec9c6ab9c013516b4 Mon Sep 17 00:00:00 2001 From: Vinzent Date: Mon, 17 Apr 2023 22:58:43 +0200 Subject: [PATCH] fix: prevent empty path --- .../supabase_functions/lib/supabase_functions_shelf.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/supabase_functions/lib/supabase_functions_shelf.dart b/packages/supabase_functions/lib/supabase_functions_shelf.dart index 89b107e..bb81079 100644 --- a/packages/supabase_functions/lib/supabase_functions_shelf.dart +++ b/packages/supabase_functions/lib/supabase_functions_shelf.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:js_util' as js_util; import 'package:edge_runtime/edge_runtime.dart'; @@ -19,6 +20,10 @@ class SupabaseFunctionsShelf { SupabaseFunctionsShelf({ this.fetch, }) { + // runZonedGuarded(() { + + // }, (error, stack) { }); + // Setup the runtime environment. setupRuntime(); @@ -37,6 +42,9 @@ class SupabaseFunctionsShelf { // Remove the first path segment, because it starts with `dart_edge/`. var uri = Uri.parse(clone.url); uri = uri.replace(pathSegments: uri.pathSegments.skip(1)); + if (uri.path.isEmpty) { + uri = uri.replace(path: "/"); + } final shelfRequest = shelf.Request( clone.method,