Skip to content

Commit

Permalink
fixup! Add validation for internal R2 requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot committed Mar 7, 2023
1 parent c72c983 commit ace5152
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/tre/src/plugins/r2/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ enum CfCode {
}

export class R2Error extends HttpError {
v4Code: number;
object?: R2Object;

constructor(status: number, message: string, v4Code: number) {
super(status, message);
this.v4Code = v4Code;

This comment has been minimized.

Copy link
@penalosa

penalosa Mar 10, 2023

Contributor

Why the deletion of v4Code? That needs to be sent to workerd, I think

This comment has been minimized.

Copy link
@mrbbot

mrbbot Mar 11, 2023

Author Contributor

It hasn't been deleted, adding modifiers to constructor parameter automatically creates class members with those modifiers and initial values. 👍

constructor(code: number, message: string, readonly v4Code: number) {
super(code, message);
}

toResponse() {
Expand Down

0 comments on commit ace5152

Please sign in to comment.