Skip to content

Conversation

@yutailang0119
Copy link
Contributor

Fix validation of png extension to be case insensitive.
I don't think it's necessary to validate case sensitive in extension.

Copy link
Owner

@Nonchalant Nonchalant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much 👏

func run() throws {
guard image.hasSuffix(".png") else {
guard let `extension` = image.split(separator: ".").last,
`extension`.caseInsensitiveCompare("png") == .orderedSame else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nonchalant Nonchalant merged commit 351956a into Nonchalant:master Dec 10, 2020
@yutailang0119 yutailang0119 deleted the feature/case-insensitive-extension branch December 10, 2020 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants