fix error while constructing responses

"Response with null body status cannot have body"
This commit is contained in:
Spencer Pogorzelski 2023-08-14 15:05:46 -07:00
parent d449ed2e42
commit 52a55f616b
2 changed files with 15 additions and 11 deletions

View file

@ -43,12 +43,9 @@ export class Connection {
let requestType = view.getUint8(cursor) as S2CRequestType;
cursor += 1;
console.log(requestID, requestType);
const msgText = () => new TextDecoder().decode(data.slice(cursor));
const msgJSON = () => JSON.parse(msgText());
console.log({ requestType });
switch (requestType) {
case S2CRequestTypes.HTTPResponseStart:
const payload = msgJSON();