@danhachuel/thunderbolt 0.4.97 → 0.4.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/cli.mjs +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.97",
3
+ "version": "0.4.98",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
package/scripts/cli.mjs CHANGED
@@ -201,7 +201,16 @@ const proxy = http.createServer((request, response) => {
201
201
  path: `${requestUrl.pathname}${requestUrl.search}`,
202
202
  headers: { ...request.headers, host: `127.0.0.1:${backendPort}` },
203
203
  }, (upstreamResponse) => {
204
- response.writeHead(upstreamResponse.statusCode || 502, upstreamResponse.headers);
204
+ const responseHeaders = { ...upstreamResponse.headers };
205
+ // Streamlit entrega HTML/JS de uma instância local que pode mudar após
206
+ // uma atualização via npx. Não permitir que o browser reaproveite uma
207
+ // página ou bundle da instância anterior.
208
+ delete responseHeaders.etag;
209
+ delete responseHeaders["last-modified"];
210
+ responseHeaders["cache-control"] = "no-store, no-cache, must-revalidate, max-age=0";
211
+ responseHeaders.pragma = "no-cache";
212
+ responseHeaders.expires = "0";
213
+ response.writeHead(upstreamResponse.statusCode || 502, responseHeaders);
205
214
  upstreamResponse.pipe(response);
206
215
  });
207
216
  upstream.on("error", (error) => {