Skip to content

Commit 848896f

Browse files
committed
save
1 parent e1ca9a0 commit 848896f

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

src/index.ts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ function basicProxy(proxy_url = ""): Handler {
104104
method: c.req.raw.method,
105105
headers: { ...headers },
106106
body: blob.size > 0 ? blob : undefined,
107+
tls: {
108+
rejectUnauthorized: false,
109+
},
107110
});
108111
} catch (error) {
109112
console.error(
@@ -168,40 +171,40 @@ function basicProxy(proxy_url = ""): Handler {
168171
} catch (error) {
169172
console.error("Error", error);
170173

171-
// I know that the request passes without headers
172-
// So I will add one by one and see which one is causing the issue
174+
// // I know that the request passes without headers
175+
// // So I will add one by one and see which one is causing the issue
173176

174-
const partialHeaders = {};
177+
// const partialHeaders = {};
175178

176-
for (const [key, value] of Object.entries(headers)) {
177-
partialHeaders[key] = value;
179+
// for (const [key, value] of Object.entries(headers)) {
180+
// partialHeaders[key] = value;
178181

179-
console.log("Trying headers", partialHeaders);
182+
// console.log("Trying headers", partialHeaders);
180183

181-
try {
182-
const response = await fetch(url, {
183-
method: c.req.raw.method,
184-
headers: partialHeaders,
185-
body: blob.size > 0 ? blob : undefined,
186-
});
184+
// try {
185+
// const response = await fetch(url, {
186+
// method: c.req.raw.method,
187+
// headers: partialHeaders,
188+
// body: blob.size > 0 ? blob : undefined,
189+
// });
187190

188-
console.log("TESTING Response", response.status, response.statusText);
189-
} catch (error) {
190-
console.error("Error", error);
191-
}
192-
}
191+
// console.log("TESTING Response", response.status, response.statusText);
192+
// } catch (error) {
193+
// console.error("Error", error);
194+
// }
195+
// }
193196

194-
console.log("TRYING HEADERS DONE");
197+
// console.log("TRYING HEADERS DONE");
195198

196-
// Test the normal call again to see how fucked this is
199+
// // Test the normal call again to see how fucked this is
197200

198-
// const response = await fetch(url, {
199-
// method: c.req.raw.method,
200-
// headers: headers,
201-
// body: blob.size > 0 ? blob : undefined,
202-
// });
201+
// // const response = await fetch(url, {
202+
// // method: c.req.raw.method,
203+
// // headers: headers,
204+
// // body: blob.size > 0 ? blob : undefined,
205+
// // });
203206

204-
// console.log("FINAL", response.status);
207+
// // console.log("FINAL", response.status);
205208

206209
return new Response("Error", {
207210
status: 500,

0 commit comments

Comments
 (0)