Skip to content

fix: unicode on exactly index 7 should not panic#25

Open
lsunsi wants to merge 1 commit intoKixunil:masterfrom
lsunsi:master
Open

fix: unicode on exactly index 7 should not panic#25
lsunsi wants to merge 1 commit intoKixunil:masterfrom
lsunsi:master

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