pi-mega-compact 0.20.77 → 0.20.78

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.
@@ -69,8 +69,11 @@ function download(url) {
69
69
  res.statusCode < 400 &&
70
70
  res.headers.location) {
71
71
  res.resume();
72
- // Follow a single redirect (HuggingFace CDN redirects).
73
- download(res.headers.location).then(resolve, reject);
72
+ // Follow a single redirect (HuggingFace CDN redirects). The Location
73
+ // header may be a RELATIVE path (e.g. /api/resolve-cache/...)resolve
74
+ // it against the original URL so httpsGet never receives a bare path.
75
+ const redirected = new URL(res.headers.location, url).toString();
76
+ download(redirected).then(resolve, reject);
74
77
  return;
75
78
  }
76
79
  if (res.statusCode !== 200) {
@@ -95,8 +95,11 @@ function download(url: string): Promise<Buffer> {
95
95
  res.headers.location
96
96
  ) {
97
97
  res.resume();
98
- // Follow a single redirect (HuggingFace CDN redirects).
99
- download(res.headers.location).then(resolve, reject);
98
+ // Follow a single redirect (HuggingFace CDN redirects). The Location
99
+ // header may be a RELATIVE path (e.g. /api/resolve-cache/...)resolve
100
+ // it against the original URL so httpsGet never receives a bare path.
101
+ const redirected = new URL(res.headers.location, url).toString();
102
+ download(redirected).then(resolve, reject);
100
103
  return;
101
104
  }
102
105
  if (res.statusCode !== 200) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mega-compact",
3
- "version": "0.20.77",
3
+ "version": "0.20.78",
4
4
  "description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",