mirror of
https://github.com/movie-web/simple-proxy.git
synced 2025-09-13 09:03:26 +00:00
Add ability to do debug logging with REQ_DEBUG=true
This commit is contained in:
@@ -6,7 +6,7 @@ export default defineNitroConfig({
|
||||
noPublicDir: true,
|
||||
srcDir: "./src",
|
||||
runtimeConfig: {
|
||||
version: pkg.version,
|
||||
version: pkg.version
|
||||
},
|
||||
alias: {
|
||||
"@": join(__dirname, "src")
|
||||
|
@@ -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