Compare commits

..

No commits in common. "bf4a803dd3695f426c37fe387353a3bfd258d34f" and "3ac9a06a9f5542ee07f0d3957d8609c0c93d0dd3" have entirely different histories.

2 changed files with 1 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/sneaker",
"version": "0.0.2",
"version": "0.0.1",
"description": "http tunnel server and client",
"module": "src/client.ts",
"type": "module",

View File

@ -113,8 +113,6 @@ export function connect(options: TunnelOptions): Tunnel {
const url = `${target}${req.path}`
const hasBody = req.method !== "GET" && req.method !== "HEAD" && req.body
console.log(`[tunnel] >> ${req.method} ${url}`, { contentType: req.headers["content-type"], bodyLen: req.body?.length, hasBody })
const response = await fetch(url, {
method: req.method,
headers: req.headers,
@ -123,7 +121,6 @@ export function connect(options: TunnelOptions): Tunnel {
})
const contentType = response.headers.get("content-type")
console.log(`[tunnel] << ${response.status} ${req.method} ${url}`, { contentType, location: response.headers.get("location") })
const headers: Record<string, string> = {}
response.headers.forEach((value, key) => {
headers[key] = value