com.jimuwd.xian.registry-proxy 1.0.18 → 1.0.20
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 +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -149,11 +149,11 @@ export async function startProxyServer(proxyConfigPath, localYarnConfigPath, glo
|
|
|
149
149
|
await limiter.acquire();
|
|
150
150
|
try {
|
|
151
151
|
const cleanRelativePath = relativePath.replace(/^\/+|\/+$/g, '');
|
|
152
|
-
const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}
|
|
152
|
+
const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}` /*.replace(/\/+/g, '/')*/;
|
|
153
153
|
console.log(`Fetching from: ${targetUrl}`);
|
|
154
154
|
const headers = token ? { Authorization: `Bearer ${token}` } : undefined;
|
|
155
155
|
const response = await fetch(targetUrl, { headers, });
|
|
156
|
-
console.log(`Response from ${
|
|
156
|
+
console.log(`Response from ${targetUrl}: ${response.status} ${response.statusText}`);
|
|
157
157
|
return response.ok ? response : null;
|
|
158
158
|
}
|
|
159
159
|
catch (e) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -188,11 +188,11 @@ export async function startProxyServer(
|
|
|
188
188
|
await limiter.acquire();
|
|
189
189
|
try {
|
|
190
190
|
const cleanRelativePath = relativePath.replace(/^\/+|\/+$/g, '');
|
|
191
|
-
const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}
|
|
191
|
+
const targetUrl = `${url}/${cleanRelativePath}${fullUrl.search || ''}`/*.replace(/\/+/g, '/')*/;
|
|
192
192
|
console.log(`Fetching from: ${targetUrl}`);
|
|
193
193
|
const headers = token ? { Authorization: `Bearer ${token}` } : undefined;
|
|
194
194
|
const response = await fetch(targetUrl, { headers, });
|
|
195
|
-
console.log(`Response from ${
|
|
195
|
+
console.log(`Response from ${targetUrl}: ${response.status} ${response.statusText}`);
|
|
196
196
|
return response.ok ? response : null;
|
|
197
197
|
} catch (e) {
|
|
198
198
|
console.error(`Failed to fetch from ${url}:`, e);
|