Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent empty path
Browse files Browse the repository at this point in the history
Vinzent03 committed Apr 17, 2023
1 parent c405e74 commit 3407358
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/supabase_functions/lib/supabase_functions_shelf.dart
Original file line number Diff line number Diff line change
@@ -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/<actual-sub-path>`.
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,

0 comments on commit 3407358

Please sign in to comment.