From 06d8362f5173fffe12b68ca2d599e1f92e74bfd6 Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Fri, 21 Nov 2025 05:36:40 +0000 Subject: [PATCH 1/3] fix(ext/runtime/http): record error if `respondWith` propagates exception --- ext/runtime/js/http.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ext/runtime/js/http.js b/ext/runtime/js/http.js index d455142f..879e1e1f 100644 --- a/ext/runtime/js/http.js +++ b/ext/runtime/js/http.js @@ -99,7 +99,17 @@ function serveHttp(conn) { streamRid: nextRequest.streamRid, }; - return nextRequest; + return { + ...nextRequest, + respondWith: async function (resp) { + try { + return await nextRequest.respondWith(resp); + } catch (error) { + console.error(error); + throw error; + } + }, + }; }; httpConn.close = () => { @@ -271,7 +281,6 @@ async function respond(requestEvent, httpConn, options, snapshot) { }), ); } catch (error) { - console.error(error); closeHttpConn(httpConn); } }); From 81a12aba92074574c012e0b3fde9209e1a317d2a Mon Sep 17 00:00:00 2001 From: Nyannyacha Date: Fri, 21 Nov 2025 05:45:16 +0000 Subject: [PATCH 2/3] chore(examples): update `README.md` --- examples/custom-jwt-validation/README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/custom-jwt-validation/README.md b/examples/custom-jwt-validation/README.md index e48b478a..ef40947f 100644 --- a/examples/custom-jwt-validation/README.md +++ b/examples/custom-jwt-validation/README.md @@ -2,19 +2,26 @@ This function exemplifies how to use a custom JWT validation. -Since Supabase legacy JWT Secret will be deprecated, users that would like to verify JWT or integrate with a custom provider should implement it manually. -> see [Upcoming changes to Supabase API Keys #29260](https://github.com/orgs/supabase/discussions/29260) +Since Supabase legacy JWT Secret will be deprecated, users that would like to +verify JWT or integrate with a custom provider should implement it manually. + +> see +> [Upcoming changes to Supabase API Keys #29260](https://github.com/orgs/supabase/discussions/29260) To simplify this task, Supabase provides a collection of JWT validation examples -that can be found at [`_shared/jwt/`](https://github.com/supabase/edge-runtime/blob/main/examples/_shared/jwt) folder. +that can be found at +[`_shared/jwt/`](https://github.com/supabase/edge-runtime/blob/main/examples/_shared/jwt) +folder. ## Setup -1. Copy/download the JWT template, then import and use it inside your edge function. +1. Copy/download the JWT template, then import and use it inside your edge + function. ```bash wget https://raw.githubusercontent.com/supabase/edge-runtime/refs/heads/main/examples/_shared/jwt/