Skip to content

Commit 73a87cf

Browse files
committed
Update transformers to catch URI::InvalidError
1 parent 5a5ffe5 commit 73a87cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/qiita/markdown/transformers/filter_iframe.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def host_of(url)
4545
scheme = URI.parse(url).scheme
4646
Addressable::URI.parse(url).host if ["http", "https"].include? scheme
4747
end
48-
rescue Addressable::URI::InvalidURIError
48+
rescue Addressable::URI::InvalidURIError, URI::InvalidURIError
4949
nil
5050
end
5151
end

lib/qiita/markdown/transformers/filter_script.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def host_of(url)
4747
scheme = URI.parse(url).scheme
4848
Addressable::URI.parse(url).host if ["http", "https"].include? scheme
4949
end
50-
rescue Addressable::URI::InvalidURIError
50+
rescue Addressable::URI::InvalidURIError, URI::InvalidURIError
5151
nil
5252
end
5353
end

0 commit comments

Comments
 (0)