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

Allow use of public_suffix 5 #155

Merged
merged 1 commit into from Oct 10, 2022
Merged

Allow use of public_suffix 5 #155

merged 1 commit into from Oct 10, 2022

Conversation

dentarg
Copy link
Collaborator

@dentarg dentarg commented Aug 19, 2022

Changes in public_suffix looks fine to me, no breaking API changes what I can see:

Addressable 2.8.1 was just released to allow use of public_suffix 5.x:
https://github.com/sporkmonger/addressable/blob/addressable-2.8.1/CHANGELOG.md#addressable-281

@dentarg
Copy link
Collaborator Author

dentarg commented Aug 19, 2022

Hmm, maybe this part needs some tweaking after sporkmonger/addressable#459

# Workaround for the following bug in addressable:
# https://github.com/sporkmonger/addressable/issues/224
def try_addressable_normalize(addressable_uri)
addressable_uri.normalize
rescue ArgumentError => error
if error.message.include?("invalid byte sequence in UTF-8")
raise Twingly::URL::Error::ParseError
end
raise
end

Haven't looked into it, I'll leave that to the real maintainers :-)

@Pontus4 Pontus4 mentioned this pull request Aug 23, 2022
@Pontus4
Copy link
Contributor

Pontus4 commented Aug 23, 2022

Hmm, maybe this part needs some tweaking after sporkmonger/addressable#459

# Workaround for the following bug in addressable:
# https://github.com/sporkmonger/addressable/issues/224
def try_addressable_normalize(addressable_uri)
addressable_uri.normalize
rescue ArgumentError => error
if error.message.include?("invalid byte sequence in UTF-8")
raise Twingly::URL::Error::ParseError
end
raise
end

Maybe this method isn't needed anymore after the updated requirements in 5ae3a68, but as I understand it sporkmonger/addressable#224 isn't completely solved yet. We don't have any URLs in the specs that fails on the normalize step, but that doesn't say that it isn't possible :)

spec/lib/twingly/url_spec.rb Outdated Show resolved Hide resolved
Changes in public_suffix looks fine to me, no breaking API changes what I can see:

* https://github.com/weppos/publicsuffix-ruby/blob/v5.0.0/CHANGELOG.md#500
* weppos/publicsuffix-ruby@v4.0.7...v5.0.0

Addressable 2.8.1 was just released to allow use of public_suffix 5.x:
https://github.com/sporkmonger/addressable/blob/addressable-2.8.1/CHANGELOG.md#addressable-281
Copy link
Contributor

@Pontus4 Pontus4 left a comment

Choose a reason for hiding this comment

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

🎉

@Pontus4 Pontus4 merged commit 0989fd5 into twingly:master Oct 10, 2022
@dentarg dentarg deleted the patch-1 branch October 29, 2022 13:40
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.

None yet

3 participants