com.jimuwd.xian.registry-proxy 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -101,12 +101,12 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
101
101
  return;
102
102
  }
103
103
  const fullUrl = new URL(req.url, `http://${req.headers.host}`);
104
+ console.log(`Received request: ${fullUrl.pathname} (Full URL: ${fullUrl.href})`); // 增强日志
104
105
  const pathname = fullUrl.pathname;
105
- console.log(`Received request: ${pathname}`);
106
106
  const fetchPromises = registries.map(async ({ url: registry, token }) => {
107
107
  const targetUrl = `${registry}${pathname}`;
108
108
  const headers = token ? { Authorization: `Bearer ${token}` } : undefined;
109
- console.log(`Fetching ${targetUrl} with headers:`, headers);
109
+ console.log(`Fetching ${targetUrl} with headers:`, JSON.stringify(headers, null, 2)); // 打印完整 headers
110
110
  try {
111
111
  const response = await fetch(targetUrl, { headers });
112
112
  console.log(`Response from ${targetUrl}: ${response.status} ${response.statusText}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.jimuwd.xian.registry-proxy",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "description": "A lightweight npm registry proxy with fallback support",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -119,13 +119,13 @@ export async function startProxyServer(proxyConfigPath?: string, localYarnConfig
119
119
  }
120
120
 
121
121
  const fullUrl = new URL(req.url, `http://${req.headers.host}`);
122
+ console.log(`Received request: ${fullUrl.pathname} (Full URL: ${fullUrl.href})`); // 增强日志
122
123
  const pathname = fullUrl.pathname;
123
- console.log(`Received request: ${pathname}`);
124
124
 
125
125
  const fetchPromises = registries.map(async ({ url: registry, token }) => {
126
126
  const targetUrl = `${registry}${pathname}`;
127
127
  const headers: Record<string, string> | undefined = token ? { Authorization: `Bearer ${token}` } : undefined;
128
- console.log(`Fetching ${targetUrl} with headers:`, headers);
128
+ console.log(`Fetching ${targetUrl} with headers:`, JSON.stringify(headers, null, 2)); // 打印完整 headers
129
129
  try {
130
130
  const response = await fetch(targetUrl, { headers });
131
131
  console.log(`Response from ${targetUrl}: ${response.status} ${response.statusText}`);