Skip to content

Commit 9f3ea0e

Browse files
committed
fix: resolve request hanging and proxy IPv4/IPv6 mismatch
- Fix Vite dev proxy: change target from localhost to 127.0.0.1 to prevent IPv6/IPv4 mismatch (Vite binds IPv6, backend binds IPv4, localhost resolves to ::1 on macOS causing proxy timeout) - Fix SingleRequest loading state: add setLoading(false) in pre-request script error path and a finally block so the spinner always clears even on failure All tests pass: 539 backend + 356 frontend
1 parent fe3588d commit 9f3ea0e

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

frontend/src/pages/SingleRequest.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export default function SingleRequest() {
152152
scriptError: preResult.error,
153153
});
154154
toast.error('Pre-request script failed', preResult.error);
155+
setLoading(tabId, false);
155156
return;
156157
}
157158

@@ -268,6 +269,8 @@ export default function SingleRequest() {
268269
consoleLogs: preScriptLogs,
269270
});
270271
toast.error('Request failed', message);
272+
} finally {
273+
setLoading(tabId, false);
271274
}
272275
}, [tab, envVars, setLoading, setResponse, addToHistory]);
273276

frontend/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export default defineConfig({
2121
host: true,
2222
proxy: {
2323
'/api': {
24-
target: 'http://localhost:8000',
24+
target: 'http://127.0.0.1:8000',
2525
changeOrigin: true,
2626
},
2727
'/health': {
28-
target: 'http://localhost:8000',
28+
target: 'http://127.0.0.1:8000',
2929
changeOrigin: true,
3030
},
3131
'/ws': {
32-
target: 'ws://localhost:8000',
32+
target: 'ws://127.0.0.1:8000',
3333
ws: true,
3434
},
3535
},

0 commit comments

Comments
 (0)