Skip to content

Commit 4bd7f44

Browse files
authored
Restore client-channel.js
1 parent c259380 commit 4bd7f44

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

worker/client-channel.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
// update worker name when updating worker
7-
const WORKER_NAME = 'codeit-worker-v536';
7+
const WORKER_NAME = 'codeit-worker-v535';
88

99

1010
// internal paths
@@ -68,20 +68,11 @@ const workerChannel = new BroadcastChannel('worker-channel');
6868

6969

7070
// create Response from data
71-
function createResponse(data, type, status, noCache) {
72-
73-
let headers = {'Content-Type': type};
74-
75-
if (noCache) {
76-
77-
headers['Cache-Control'] = 'public, max-age=0, must-revalidate';
78-
79-
}
80-
71+
function createResponse(data, type, status) {
8172

8273
// create Response from data
8374
const response = new Response(data, {
84-
headers: headers,
75+
headers: {'Content-Type': type},
8576
status: status
8677
});
8778

@@ -151,7 +142,7 @@ function sendRequestToClient(request, clientId) {
151142

152143

153144
// create Response from data
154-
const response = createResponse(event.data.resp, mimeType, event.data.respStatus, true);
145+
const response = createResponse(event.data.resp, mimeType, event.data.respStatus);
155146

156147
if (enableDevLogs) {
157148
console.debug('[ServiceWorker] Resolved live view request with client response', response, event.data.resp, event.data.respStatus);
@@ -260,7 +251,7 @@ function handleFetchRequest(request, event) {
260251
const clientId = event.clientId;
261252

262253
resolve(createResponse(
263-
JSON.stringify({ clientId }), 'application/json', 200, true
254+
JSON.stringify({ clientId }), 'application/json', 200
264255
));
265256

266257
} else { // if fetch is external

0 commit comments

Comments
 (0)