1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Page refresh is broken in development mode, fixes #6818 (#6844)

Signed-off-by: Roman <ixrock@gmail.com>

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2022-12-29 13:36:51 +02:00 committed by GitHub
parent 6422d8183f
commit c33a5f12ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ const devStaticFileRouteHandlerInjectable = getInjectable({
const proxyTarget = `http://127.0.0.1:${webpackDevServerPort}`; const proxyTarget = `http://127.0.0.1:${webpackDevServerPort}`;
return async ({ raw: { req, res }}: LensApiRequest<"/{path*}">): Promise<RouteResponse<Buffer>> => { return async ({ raw: { req, res }}: LensApiRequest<"/{path*}">): Promise<RouteResponse<Buffer>> => {
if (req.url === "/" || !req.url) { if (req.url === "/" || !req.url || !req.url.startsWith(publicPath)) {
req.url = `${publicPath}/index.html`; req.url = `${publicPath}/index.html`;
} else if (!req.url.startsWith("/build/")) { } else if (!req.url.startsWith("/build/")) {
return { statusCode: 404 }; return { statusCode: 404 };