Skip to content

Commit 04d4ca1

Browse files
committed
Fix LocalBucket operation names from command classes
This probably never worked since the last refactor. We never noticed because `"Function" == "Function"`.
1 parent f7ab225 commit 04d4ca1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/file/bucket/local-bucket.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export abstract class LocalBucket<
8787
input: SignedOp<TCommandInput>,
8888
) {
8989
const signed = JSON.stringify({
90-
operation: operation.constructor.name,
90+
operation: operation.name.replace(/Command$/, ''),
9191
...input,
9292
signing: {
9393
...input.signing,
@@ -119,7 +119,10 @@ export abstract class LocalBucket<
119119
const parsed = this.parseSignedUrl(u) as SignedOp<TCommandInput> & {
120120
operation: string;
121121
};
122-
assert(parsed.operation === operation.constructor.name);
122+
assert(
123+
parsed.operation === operation.name ||
124+
`${parsed.operation}Command` === operation.name,
125+
);
123126
return parsed;
124127
} catch (e) {
125128
throw new InvalidSignedUrlException(e);

0 commit comments

Comments
 (0)