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

Allow 0x prefix for hex strings #3011

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

BolajiOlajide
Copy link
Contributor

Closes #2386

This PR updates the regex for validating hexadecimal. This allows hexes with the 0x prefix to be validated properly and those without to also pass validation provided they're valid hex strings.

CleanShot 2024-01-10 at 03 03 26@2x

@BolajiOlajide
Copy link
Contributor Author

Kindly take a look @Marsup

@Marsup
Copy link
Collaborator

Marsup commented Jan 15, 2024

Thanks for the PR. This feels like we should add an option (defaulting to false) to support this, otherwise I would consider it a breaking change. It would probably be more flexible anyway.

@BolajiOlajide
Copy link
Contributor Author

Thanks for the PR. This feels like we should add an option (defaulting to false) to support this, otherwise I would consider it a breaking change. It would probably be more flexible anyway.

Updated!

@Marsup Marsup added this to the 17.12.0 milestone Jan 17, 2024
@Marsup Marsup self-assigned this Jan 17, 2024
@Marsup
Copy link
Collaborator

Marsup commented Jan 17, 2024

I'm going to do some changes before releasing it but it's already a good start, thanks a lot!

@Marsup Marsup merged commit d2a9082 into hapijs:master Jan 17, 2024
9 checks passed
Marsup added a commit that referenced this pull request Jan 17, 2024
@Marsup Marsup added the feature New functionality or improvement label Jan 17, 2024
@Marsup Marsup mentioned this pull request Jan 17, 2024
@richardpringle
Copy link

🙌

@BolajiOlajide BolajiOlajide deleted the bo/allow-hex-with-prefix branch May 5, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow 0x prefix for hex strings
3 participants