Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: base64 options doesn't apply #2548

Open
aseyfpour opened this issue Nov 1, 2024 · 0 comments · May be fixed by #2549
Open

fix: base64 options doesn't apply #2548

aseyfpour opened this issue Nov 1, 2024 · 0 comments · May be fixed by #2549
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.

Comments

@aseyfpour
Copy link

Description

By passing { urlSafe: true } to @IsBase64, it is supposed to validate base64url correctly, but it doesn’t seem to work properly.

Minimal code-snippet showcasing the problem

export class Base64Test {
  @IsBase64({ urlSafe: true })
  base64: string;

  static from(base64: string): Base64Test {
    return plainToInstance(Base64Test, { base64 });
  }
}

const obj = Base64Test.from("dGVzdA");
const errors = await validate(obj);

if (errors.length > 0) {
  console.log("Failed to validate")
} else {
  console.log("Successfully validated")
}

Expected behavior

It should log Successfully validated

Actual behavior

It logs Failed to validate

@aseyfpour aseyfpour added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Nov 1, 2024
@aseyfpour aseyfpour linked a pull request Nov 1, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.
Development

Successfully merging a pull request may close this issue.

1 participant