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: unicode on exactly index 7 should not panic #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lsunsi
Copy link

@lsunsi lsunsi commented Sep 23, 2024

Problem

A unicode character on exactly the right place (where the previous code used to split the string) would cause a panic.

Fix

Treat the string as unicode in order to compare the scheme, turning the panic into error.

@lsunsi
Copy link
Author

lsunsi commented Sep 25, 2024

Just updated the PR to use a simpler way of safe slicing (get instead of []). @Kixunil Can you give some insight if this PR makes sense? I'd fix a panic I've been getting in production using this lib!

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