mirror of
https://github.com/movie-web/simple-proxy.git
synced 2025-09-13 17:13:26 +00:00
Add ability to do debug logging with REQ_DEBUG=true
This commit is contained in:
@@ -69,7 +69,15 @@ export async function specificProxyRequest(
|
||||
opts.fetchOptions?.headers,
|
||||
opts.headers,
|
||||
);
|
||||
(fetchHeaders.forEach as any)(console.log);
|
||||
const headerObj = Object.fromEntries([...(fetchHeaders.entries as any)()]);
|
||||
if (process.env.REQ_DEBUG === 'true') {
|
||||
console.log({
|
||||
type: 'request',
|
||||
method,
|
||||
url: target,
|
||||
headers: headerObj,
|
||||
});
|
||||
}
|
||||
|
||||
return sendProxy(event, target, {
|
||||
...opts,
|
||||
|
Reference in New Issue
Block a user