posts: fix exception when post has source like 'https://www.twitter.com/username'.

`twitter.com` sources worked but `www.twitter.com` didn't.

Also match the URL by class instead of by site name to ensure we match
the expected class.
This commit is contained in:
evazion
2022-03-20 20:43:22 -05:00
parent 1ad0e8688d
commit 7394660ba9
9 changed files with 10 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
module Sources::Strategies
class TwitPic < Base
def match?
parsed_url&.site_name == "TwitPic"
Source::URL::TwitPic === parsed_url
end
def normalize_for_source