Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d8f7b74

Browse files
committed
Remove unpaired surrogate pair regexp R2 key validation
This restriction no longer seems to apply
1 parent 4f95fa3 commit d8f7b74

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

packages/tre/src/plugins/r2/validator.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import { R2Conditional } from "./schemas";
1212

1313
export const MAX_LIST_KEYS = 1_000;
1414
const MAX_KEY_SIZE = 1024;
15-
16-
const UNPAIRED_SURROGATE_PAIR_REGEX =
17-
/^(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])$/;
1815
const MAX_VALUE_SIZE = 5 * 1_000 * 1_000 * 1_000 - 5 * 1_000 * 1_000;
1916

2017
function identity(ms: number) {
@@ -106,11 +103,7 @@ export class Validator {
106103
}
107104

108105
key(key: string): Validator {
109-
// Check key isn't too long and exists outside regex
110106
const keyLength = Buffer.byteLength(key);
111-
if (UNPAIRED_SURROGATE_PAIR_REGEX.test(key)) {
112-
throw new InvalidObjectName();
113-
}
114107
if (keyLength >= MAX_KEY_SIZE) {
115108
throw new InvalidObjectName();
116109
}

0 commit comments

Comments
 (0)