@oxidezap/baileyrs 0.3.15 → 0.3.17

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.
@@ -153,7 +153,8 @@ export const makeTransport = (config) => {
153
153
  };
154
154
  export const makeHttpClient = (config) => ({
155
155
  async execute(url, method, headers, body) {
156
- const fetchOpts = { method, headers, redirect: 'error' };
156
+ // Workers supports manual redirects. Keep the bridge on the original authority.
157
+ const fetchOpts = { method, headers, redirect: 'manual' };
157
158
  if (body)
158
159
  fetchOpts.body = body;
159
160
  if (config.options?.dispatcher)
@@ -162,6 +163,10 @@ export const makeHttpClient = (config) => ({
162
163
  if (resp.status === 0 || resp.type === 'opaqueredirect') {
163
164
  throw new Error('HTTP adapter received an unobservable redirect or network response');
164
165
  }
166
+ if (resp.status >= 300 && resp.status < 400) {
167
+ await resp.body?.cancel();
168
+ throw new TypeError(`HTTP adapter rejected redirect (HTTP ${resp.status})`);
169
+ }
165
170
  const buf = new Uint8Array(await resp.arrayBuffer());
166
171
  return { statusCode: resp.status, body: buf };
167
172
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oxidezap/baileyrs",
3
3
  "type": "module",
4
- "version": "0.3.15",
4
+ "version": "0.3.17",
5
5
  "description": "A Rust-powered WhatsApp Web library for JavaScript, with a Baileys-compatible API",
6
6
  "keywords": [
7
7
  "whatsapp",
@@ -108,21 +108,21 @@
108
108
  "@types/node": "^26.1.1",
109
109
  "baileys": "7.0.0-rc14",
110
110
  "jimp": "^1.6.0",
111
- "link-preview-js": "^5.0.0",
111
+ "link-preview-js": "^6.0.0",
112
112
  "music-metadata": "^12.2.2",
113
- "oxfmt": "^0.77.0",
114
- "oxlint": "1.92.0",
113
+ "oxfmt": "^0.79.0",
114
+ "oxlint": "1.94.0",
115
115
  "pino": "^10.3.1",
116
116
  "pino-pretty": "^13.1.3",
117
- "pkg-pr-new": "^0.0.93",
117
+ "pkg-pr-new": "^0.0.94",
118
118
  "protobufjs": "^8.8.0",
119
119
  "tsc-esm-fix": "^3.1.2",
120
120
  "typescript": "^7.0.2",
121
121
  "typescript-compat-auditor": "npm:typescript@6.0.3",
122
- "undici": "7.30.1",
123
- "vite": "8.3.6",
122
+ "undici": "7.30.2",
123
+ "vite": "8.3.8",
124
124
  "vitest": "5.1.0",
125
- "wrangler": "4.158.0"
125
+ "wrangler": "4.164.0"
126
126
  },
127
127
  "peerDependencies": {
128
128
  "@hapi/boom": "^9.1.0 || ^10.0.0",