@fefade/common 1.0.7 → 1.0.8

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
@@ -14046,7 +14046,8 @@ function isRateLimiterRes(err) {
14046
14046
  }
14047
14047
  function withRateLimit_default(handler, limiter) {
14048
14048
  return async (event) => {
14049
- const ipAddress = getIp_default(event.request);
14049
+ const requestCloned = event.request.clone();
14050
+ const ipAddress = getIp_default(requestCloned);
14050
14051
  try {
14051
14052
  await limiter.consume(ipAddress);
14052
14053
  } catch (err) {
@@ -14076,7 +14077,8 @@ function validateTurnstile_default(handler, secretKey) {
14076
14077
  }
14077
14078
  });
14078
14079
  }
14079
- const body = await event.request.json();
14080
+ const requestCloned = event.request.clone();
14081
+ const body = await requestCloned.json();
14080
14082
  const token = body["cf-turnstile-response"];
14081
14083
  const ipAddress = getIp_default(event.request);
14082
14084
  if (!token) {
package/dist/index.mjs CHANGED
@@ -14018,7 +14018,8 @@ function isRateLimiterRes(err) {
14018
14018
  }
14019
14019
  function withRateLimit_default(handler, limiter) {
14020
14020
  return async (event) => {
14021
- const ipAddress = getIp_default(event.request);
14021
+ const requestCloned = event.request.clone();
14022
+ const ipAddress = getIp_default(requestCloned);
14022
14023
  try {
14023
14024
  await limiter.consume(ipAddress);
14024
14025
  } catch (err) {
@@ -14048,7 +14049,8 @@ function validateTurnstile_default(handler, secretKey) {
14048
14049
  }
14049
14050
  });
14050
14051
  }
14051
- const body = await event.request.json();
14052
+ const requestCloned = event.request.clone();
14053
+ const body = await requestCloned.json();
14052
14054
  const token = body["cf-turnstile-response"];
14053
14055
  const ipAddress = getIp_default(event.request);
14054
14056
  if (!token) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fefade/common",
3
3
  "description": "Containing common resources, constants, images, and utility functions that are used across various projects. This package aims to promote reusability and maintain consistency across different applications by centralizing commonly used assets and code.",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"