Skip to content

Commit 3407358

Browse files
committed
fix: prevent empty path
1 parent c405e74 commit 3407358

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/supabase_functions/lib/supabase_functions_shelf.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:async';
12
import 'dart:js_util' as js_util;
23

34
import 'package:edge_runtime/edge_runtime.dart';
@@ -19,6 +20,10 @@ class SupabaseFunctionsShelf {
1920
SupabaseFunctionsShelf({
2021
this.fetch,
2122
}) {
23+
// runZonedGuarded(() {
24+
25+
// }, (error, stack) { });
26+
2227
// Setup the runtime environment.
2328
setupRuntime();
2429

@@ -37,6 +42,9 @@ class SupabaseFunctionsShelf {
3742
// Remove the first path segment, because it starts with `dart_edge/<actual-sub-path>`.
3843
var uri = Uri.parse(clone.url);
3944
uri = uri.replace(pathSegments: uri.pathSegments.skip(1));
45+
if (uri.path.isEmpty) {
46+
uri = uri.replace(path: "/");
47+
}
4048

4149
final shelfRequest = shelf.Request(
4250
clone.method,

0 commit comments

Comments
 (0)