We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
v10
base64url validator is faulty. It requires padding even though padding is optional in URL safe encoding.
package main import ( "encoding/base64" "fmt" "github.com/go-playground/validator/v10" ) func main() { msg := "hello" msgB64url := base64.RawURLEncoding.EncodeToString([]byte(msg)) val := validator.New() fmt.Println(msgB64url) // prints "aGVsbG8" fmt.Println(val.Var(msgB64url, "base64url")) }
The text was updated successfully, but these errors were encountered:
@maticmeznar Could you provide a simple example of the faulty validation?
Sorry, something went wrong.
Here is a an example code. val.Var should not return an error.
Will see what can be done about this, or feel free to open a PR yourself, since this indeed is a bug.
@zemzale - i have opened a pull request for this. Can you please check?
Successfully merging a pull request may close this issue.
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
base64url validator is faulty. It requires padding even though padding is optional in URL safe encoding.
Code sample, to showcase or reproduce:
The text was updated successfully, but these errors were encountered: