Skip to content

Commit ce512c2

Browse files
authored
Remove hardcoded hostname from nextUri
1 parent 4ed1f00 commit ce512c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

precise/src/AsyncTrinoClient.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class TrinoQueryRunner {
6666
state.stats.state = 'CANCELLING'
6767
this.state = state
6868
this.setStatus(state)
69-
const nextUri = state.nextUri.replace('http://localhost:8080', '')
69+
const nextUri = state.nextUri.replace(/^https?:\/\/[^/]+/, '')
70+
7071
// cancel query
7172
fetch(nextUri, {
7273
method: 'DELETE',
@@ -255,7 +256,7 @@ class TrinoQueryRunner {
255256
async NextPage(previous: any) {
256257
try {
257258
// fix cors for testing
258-
const nextUri = await previous.nextUri.replace('http://localhost:8080', '')
259+
const nextUri = await previous.nextUri.replace(/^https?:\/\/[^/]+/, '')
259260
const response = await fetch(nextUri, {
260261
method: 'GET',
261262
headers: {

0 commit comments

Comments
 (0)