From 1aa5816808af4853399a15734a0cf66472d43468 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Tue, 29 Jul 2025 11:49:38 -0700 Subject: [PATCH] fix: remove hostname from nextUri using regex --- precise/src/AsyncTrinoClient.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/precise/src/AsyncTrinoClient.tsx b/precise/src/AsyncTrinoClient.tsx index 944edfb..8043819 100644 --- a/precise/src/AsyncTrinoClient.tsx +++ b/precise/src/AsyncTrinoClient.tsx @@ -66,7 +66,8 @@ class TrinoQueryRunner { state.stats.state = 'CANCELLING' this.state = state this.setStatus(state) - const nextUri = state.nextUri.replace('http://localhost:8080', '') + const nextUri = state.nextUri.replace(/^https?:\/\/[^/]+/, '') + // cancel query fetch(nextUri, { method: 'DELETE', @@ -255,7 +256,7 @@ class TrinoQueryRunner { async NextPage(previous: any) { try { // fix cors for testing - const nextUri = await previous.nextUri.replace('http://localhost:8080', '') + const nextUri = await previous.nextUri.replace(/^https?:\/\/[^/]+/, '') const response = await fetch(nextUri, { method: 'GET', headers: {