Skip to content

Commit

Permalink
Do not blow up on Addressable::IDNA::PunycodeBigOutput
Browse files Browse the repository at this point in the history
Related to #112.
  • Loading branch information
dentarg committed Mar 23, 2017
1 parent 1a771ea commit 3f2a1be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/twingly/url.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require "addressable/idna"
require "addressable/uri"
require "public_suffix"

Expand All @@ -14,6 +15,7 @@ class URL
CUSTOM_PSL = PublicSuffixList.with_punycoded_names
ENDS_WITH_SLASH = /\/+$/
ERRORS_TO_EXTEND = [
Addressable::IDNA::PunycodeBigOutput,
Addressable::URI::InvalidURIError,
PublicSuffix::DomainInvalid,
]
Expand Down
3 changes: 3 additions & 0 deletions spec/lib/twingly/url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def invalid_urls
# https://github.com/sporkmonger/addressable/issues/224
"http://some_site.net%C2",
"http://+%D5d.some_site.net",

# Triggers Addressable::IDNA::PunycodeBigOutput
"http://40world-many.ru&passwd=pUXFGc0LS5&subject=%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%B0+%D0%BA%D0%B0%D1%80%D0%B4%D0%B0%D0%BD%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B2%D0%B0%D0%BB%D0%B0&commit=Predict&complex=true&complex=false&membrane=false&coil=false&msa_control=all&secStructPred=true&secStructPred=false&falseRate=5&output=opnone&modeller=&seqalign=yes&database=PfamA&eval=0.01&iterations=5&domssea=yes&secpro=yes&pp=yes",
]
end

Expand Down

0 comments on commit 3f2a1be

Please sign in to comment.