resend 6.36.0 → 6.36.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/index.cjs CHANGED
@@ -57,7 +57,7 @@ const MOVE_THREAD_FOLDERS = [
57
57
  ];
58
58
  //#endregion
59
59
  //#region package.json
60
- var version = "6.36.0";
60
+ var version = "6.36.1";
61
61
  //#endregion
62
62
  //#region src/common/utils/build-pagination-query.ts
63
63
  function buildPaginationUrl(base, options) {
@@ -386,12 +386,22 @@ function buildRecipientsQuery(options) {
386
386
  //#region src/common/utils/has-dot-segment.ts
387
387
  const DOT_SEGMENT = /^(?:\.|%2e){1,2}$/i;
388
388
  /**
389
+ * Drops what URL parsing drops before it resolves dot segments: tabs and
390
+ * newlines anywhere, and control characters or spaces at the end.
391
+ */
392
+ function stripIgnoredCharacters(requestPath) {
393
+ let path = requestPath.replace(/[\t\n\r]/g, "");
394
+ while (path.length > 0 && path.charCodeAt(path.length - 1) <= 32) path = path.slice(0, -1);
395
+ return path;
396
+ }
397
+ /**
389
398
  * Whether a request path contains a `.` or `..` segment. URL parsing resolves
390
399
  * these (even when percent-encoded), so the request would reach another path.
400
+ * In http(s) URLs a `\` separates segments the same way `/` does.
391
401
  */
392
402
  function hasDotSegment(requestPath) {
393
- const [pathname] = requestPath.split(/[?#]/);
394
- return pathname.split("/").some((segment) => DOT_SEGMENT.test(segment));
403
+ const [pathname] = stripIgnoredCharacters(requestPath).split(/[?#]/);
404
+ return pathname.split(/[\\/]/).some((segment) => DOT_SEGMENT.test(segment));
395
405
  }
396
406
  //#endregion
397
407
  //#region src/common/utils/parse-contact-properties-to-api-options.ts
package/dist/index.mjs CHANGED
@@ -33,7 +33,7 @@ const MOVE_THREAD_FOLDERS = [
33
33
  ];
34
34
  //#endregion
35
35
  //#region package.json
36
- var version = "6.36.0";
36
+ var version = "6.36.1";
37
37
  //#endregion
38
38
  //#region src/common/utils/build-pagination-query.ts
39
39
  function buildPaginationUrl(base, options) {
@@ -362,12 +362,22 @@ function buildRecipientsQuery(options) {
362
362
  //#region src/common/utils/has-dot-segment.ts
363
363
  const DOT_SEGMENT = /^(?:\.|%2e){1,2}$/i;
364
364
  /**
365
+ * Drops what URL parsing drops before it resolves dot segments: tabs and
366
+ * newlines anywhere, and control characters or spaces at the end.
367
+ */
368
+ function stripIgnoredCharacters(requestPath) {
369
+ let path = requestPath.replace(/[\t\n\r]/g, "");
370
+ while (path.length > 0 && path.charCodeAt(path.length - 1) <= 32) path = path.slice(0, -1);
371
+ return path;
372
+ }
373
+ /**
365
374
  * Whether a request path contains a `.` or `..` segment. URL parsing resolves
366
375
  * these (even when percent-encoded), so the request would reach another path.
376
+ * In http(s) URLs a `\` separates segments the same way `/` does.
367
377
  */
368
378
  function hasDotSegment(requestPath) {
369
- const [pathname] = requestPath.split(/[?#]/);
370
- return pathname.split("/").some((segment) => DOT_SEGMENT.test(segment));
379
+ const [pathname] = stripIgnoredCharacters(requestPath).split(/[?#]/);
380
+ return pathname.split(/[\\/]/).some((segment) => DOT_SEGMENT.test(segment));
371
381
  }
372
382
  //#endregion
373
383
  //#region src/common/utils/parse-contact-properties-to-api-options.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "6.36.0",
3
+ "version": "6.36.1",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",