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

Base64Url throws MalformedInput when status InvalidData is expected #93

Closed
gfoidl opened this issue Nov 5, 2019 · 2 comments · Fixed by #94
Closed

Base64Url throws MalformedInput when status InvalidData is expected #93

gfoidl opened this issue Nov 5, 2019 · 2 comments · Fixed by #94
Assignees
Milestone

Comments

@gfoidl
Copy link
Owner

gfoidl commented Nov 5, 2019

The api are thought to be exception-less, that why they use OperationStatus.
Base64.Url can throw a FormatException (malformed input) in some cases. Maybe it's better to not throw the exception and just return OperationStatus.InvalidData?

@gfoidl gfoidl added this to the v1.0.1 milestone Nov 5, 2019
@gfoidl gfoidl self-assigned this Nov 5, 2019
@gfoidl
Copy link
Owner Author

gfoidl commented Nov 5, 2019

Ups, I think I've looked to the wrong overload, namely to one that returns byte[], so the behavior is OK.

@gfoidl gfoidl closed this as completed Nov 5, 2019
@gfoidl
Copy link
Owner Author

gfoidl commented Nov 5, 2019

There's still one pattern where this is hit, but a rare pattern. Though it should behave correct.
If input is A (a single character). It's not valid base64Url, but it should result in InvalidData instead of throwing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant