Skip to content

Commit 805d429

Browse files
authored
UI: Fix dev routing for S3 GW (#7801)
1 parent deac06d commit 805d429

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎webui/vite.config.mts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import react from '@vitejs/plugin-react-swc';
22
import eslintPlugin from 'vite-plugin-eslint';
33
import replace from '@rollup/plugin-replace';
44
import { splitVendorChunkPlugin } from 'vite';
5+
import * as http from "node:http";
56

67
// https://vitejs.dev/config/
78
export default ({ command }) => {
@@ -48,6 +49,17 @@ export default ({ command }) => {
4849
target: 'http://localhost:8000',
4950
changeOrigin: false,
5051
secure: false
52+
},
53+
'/': {
54+
target: 'http://localhost:8000',
55+
changeOrigin: false,
56+
secure: false,
57+
bypass: (req: http.IncomingMessage) : void | null | undefined | false | string => {
58+
if ("x-amz-date" in req.headers) {
59+
return null;
60+
}
61+
return req.url;
62+
}
5163
}
5264
}
5365
},

0 commit comments

Comments
 (0)