mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-14 23:00:01 -04:00
fix some stuff
This commit is contained in:
parent
8ed59e901d
commit
508b265df2
3 changed files with 15 additions and 15 deletions
|
@ -254,8 +254,8 @@ export class BareClient {
|
|||
origin: origin,
|
||||
protocols: protocols,
|
||||
requestHeaders: requestHeaders,
|
||||
channel: channel.port2,
|
||||
},
|
||||
websocketChannel: channel.port2,
|
||||
}, [channel.port2])
|
||||
|
||||
// protocol is always an empty before connecting
|
||||
|
@ -356,15 +356,15 @@ export class BareClient {
|
|||
if ('host' in headers) headers.host = urlO.host;
|
||||
else headers.Host = urlO.host;
|
||||
|
||||
const message = Object.assign({
|
||||
let resp = (await this.worker.sendMessage(<WorkerMessage>{
|
||||
type: "fetch",
|
||||
fetch: {
|
||||
remote: urlO.toString(),
|
||||
method: req.method,
|
||||
headers: headers,
|
||||
body: body || undefined,
|
||||
},
|
||||
}, body ? { fetchBody: body } : {});
|
||||
let resp = (await this.worker.sendMessage(message as WorkerMessage, body ? [body] : [])).fetch;
|
||||
}, body ? [body] : [])).fetch;
|
||||
|
||||
let responseobj: BareResponse & Partial<BareResponseFetch> = new Response(
|
||||
statusEmpty.includes(resp.status) ? undefined : resp.body, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue