Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use better regex for IPv6 to allow a lot more valid IPv6 addresses #753

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

Merged
merged 7 commits into from
May 10, 2021

Conversation

pauldekkers
Copy link
Contributor

The current IPv6address regular expression leaves out a lot of IPv6 addresses, among which the loopback address ::1 which is important for Loopback Interface Redirection (as described in RFC8252, https://tools.ietf.org/html/rfc8252#section-7.3). Also shorter addresses like fd01::1 or anything between this and a full length address seemed to be left out.

This is a much shorter regular expression, and a suggestion for one that does match a lot of valid IPv6 addresses (if done by regular expressions - an alternative would be the use of socket or maybe IPAddr).

Copy link
Contributor

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

thanks for the PR, can you also update some unit tests?

@pauldekkers
Copy link
Contributor Author

Hi! Hope this is what you had in mind - there were no unit tests at all for uri_validate or is_absolute_uri() so I tested for some cases, among which the ones that failed before the a046668

@pauldekkers pauldekkers requested a review from auvipy April 3, 2021 16:23
@pauldekkers pauldekkers requested a review from auvipy April 6, 2021 06:41
@auvipy auvipy requested a review from JonathanHuot April 6, 2021 08:24
@pauldekkers
Copy link
Contributor Author

Hi; it looks like this PR is stuck on review, @auvipy @JonathanHuot?

@auvipy auvipy merged commit 2b8a448 into oauthlib:master May 10, 2021
@JonathanHuot JonathanHuot added this to the 3.1.1 milestone Jun 2, 2021
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.

3 participants