mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
fix: websocket prototype
This commit is contained in:
parent
51f1a773a4
commit
58fed66f78
5 changed files with 221 additions and 222 deletions
20
static/sw.js
20
static/sw.js
|
@ -53,17 +53,19 @@ scramjet.addEventListener("request", (e) => {
|
|||
e.response = new Response(playgroundData.js, {
|
||||
headers,
|
||||
});
|
||||
e.response.rawHeaders = headers;
|
||||
e.response.rawResponse = {
|
||||
body: e.response.body,
|
||||
headers: headers,
|
||||
status: e.response.status,
|
||||
statusText: e.response.statusText,
|
||||
};
|
||||
e.response.finalURL = e.url.toString();
|
||||
} else {
|
||||
return;
|
||||
e.response = new Response("empty response", {
|
||||
headers,
|
||||
});
|
||||
}
|
||||
e.response.rawHeaders = headers;
|
||||
e.response.rawResponse = {
|
||||
body: e.response.body,
|
||||
headers: headers,
|
||||
status: e.response.status,
|
||||
statusText: e.response.statusText,
|
||||
};
|
||||
e.response.finalURL = e.url.toString();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue