diff --git a/lib/utils/ofetch.ts b/lib/utils/ofetch.ts index 0ea437355..2cddd52e3 100644 --- a/lib/utils/ofetch.ts +++ b/lib/utils/ofetch.ts @@ -26,6 +26,11 @@ const rofetch = createFetch().create({ headers: { 'user-agent': config.ua, }, + onResponse({ request, response }) { + if (response.redirected) { + logger.http(`Redirecting to ${response.url} for ${request}`); + } + }, }); export default rofetch; diff --git a/package.json b/package.json index 1f2605a63..0c0fc5cbb 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "scripts": { "build": "tsx scripts/workflow/build-routes.ts", "build:docs": "tsx scripts/workflow/build-docs.ts", - "dev": "cross-env NODE_ENV=dev tsx watch --clear-screen=false lib/index.ts", + "dev": "cross-env NODE_ENV=dev tsx watch --inspect --clear-screen=false lib/index.ts", "dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts", "format": "prettier \"**/*.{ts,tsx,js,json}\" --write && eslint --cache --fix \"**/*.{ts,tsx,js,yml}\"", "format:check": "prettier \"**/*.{ts,tsx,js,json}\" --check && eslint --cache \"**/*.{ts,tsx,js,yml}\"",