diff --git a/frontend/index.html b/frontend/index.html index 1154229..d238940 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - Rems Intermediary UI + PIMS Pharmacy
diff --git a/frontend/vite-xss-middleware.ts b/frontend/vite-xss-middleware.ts new file mode 100644 index 0000000..215c5e6 --- /dev/null +++ b/frontend/vite-xss-middleware.ts @@ -0,0 +1,40 @@ +// vite-xss-fix.ts +import { Plugin } from 'vite'; + +export function viteXssMiddleware(): Plugin { + const middleware = (req: any, res: any, next: any) => { + const originalEnd = res.end; + const chunks: any[] = []; + + res.end = function (chunk?: any) { + if (chunk) chunks.push(Buffer.from(chunk)); + + const body = Buffer.concat(chunks).toString(); + + // If Vite's error message is reflecting user input, replace it + if (body.includes('did you mean to visit') && body.includes('