kizlo 0.27.0 → 0.27.1
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/package.js +1 -1
- package/dist/wordpress/transport.js +13 -2
- package/package.json +1 -1
package/dist/package.js
CHANGED
|
@@ -234,13 +234,24 @@ var WordPressTransport = class {
|
|
|
234
234
|
"HEAD",
|
|
235
235
|
"OPTIONS"
|
|
236
236
|
].includes(input.method);
|
|
237
|
-
|
|
237
|
+
const response = await fetch(url.toString(), {
|
|
238
238
|
headers,
|
|
239
239
|
method: input.method,
|
|
240
240
|
signal,
|
|
241
|
-
...clientIp ? { redirect: "
|
|
241
|
+
...clientIp ? { redirect: "manual" } : {},
|
|
242
242
|
...hasBody && body !== void 0 ? { body } : {}
|
|
243
243
|
});
|
|
244
|
+
if (clientIp && [
|
|
245
|
+
301,
|
|
246
|
+
302,
|
|
247
|
+
303,
|
|
248
|
+
307,
|
|
249
|
+
308
|
|
250
|
+
].includes(response.status)) {
|
|
251
|
+
await response.body?.cancel();
|
|
252
|
+
throw new TypeError("WordPress redirects are not allowed when forwarding a client IP");
|
|
253
|
+
}
|
|
254
|
+
return response;
|
|
244
255
|
}
|
|
245
256
|
#serializeBody(body, contentType) {
|
|
246
257
|
if (body === void 0 || body === null) return void 0;
|