Subject: | matches http only |
Hi! Thanks for great module. This will replace some portion of my code.
Seems like your regular expressions checks only for http, not https. This causes unexpected behavior:
$l->try('http://is.gd/example'); #gives https://is.gd.example, not http://www.example.com
#Because behind the scenes, redirection happens as http://is.gd -> https://is.gd -> www.example.com
Replacing 'http' with 'https?' (optional s) fixes the issue for me, you can find the patch attached. I did not replace http with https in documentation though.
If you don't have time, or don't want to update the package, I'm happy to maintain it. Please let me know if that's the case.
Have a great day!
Subject: | https.patch |
10,20c10,20
< '0rz' => qr{^http://0rz\.tw/.+},
< Metamark => qr{^http://xrl\.us/.+},
< SnipURL => qr{^http://snipurl\.com/.+},
< TinyURL => qr{^http://tinyurl\.com/.+},
< snurl => qr{^http://snurl\.com/.+},
< bitly => qr{^http://bit\.ly/.+},
< htly => qr{^http://ht\.ly/.+},
< isgd => qr{^http://is\.gd/.+},
< owly => qr{^http://ow\.ly/.+},
< urlchen => qr{^http://urlchen\.de/.+},
< google => qr{^http://goo\.gl/.+},
---
> '0rz' => qr{^https?://0rz\.tw/.+},
> Metamark => qr{^https?://xrl\.us/.+},
> SnipURL => qr{^https?://snipurl\.com/.+},
> TinyURL => qr{^https?://tinyurl\.com/.+},
> snurl => qr{^https?://snurl\.com/.+},
> bitly => qr{^https?://bit\.ly/.+},
> htly => qr{^https?://ht\.ly/.+},
> isgd => qr{^https?://is\.gd/.+},
> owly => qr{^https?://ow\.ly/.+},
> urlchen => qr{^https?://urlchen\.de/.+},
> google => qr{^https?://goo\.gl/.+},
25,29c25,29
< twitterco => qr{^http://t\.co/.+},
< hatena => qr{^http://htn\.to/.+},
< jmp => qr{^http://j\.mp/.+},
< tumblr => qr{^http://tmblr\.co/.+},
< facebook => qr{^http://fb\.me/.+},
---
> twitterco => qr{^https?://t\.co/.+},
> hatena => qr{^https?://htn\.to/.+},
> jmp => qr{^https?://j\.mp/.+},
> tumblr => qr{^https?://tmblr\.co/.+},
> facebook => qr{^https?://fb\.me/.+},
33,34c33,34
< OneShortLink => [ qr{^http://1sl\.net/.+}, 'OneShortLink' ],
< Shorl => [ qr{^http://shorl\.com/.+}, 'Shorl' ],
---
> OneShortLink => [ qr{^https?://1sl\.net/.+}, 'OneShortLink' ],
> Shorl => [ qr{^https?://shorl\.com/.+}, 'Shorl' ],
39,60c39,60
< icanhaz => qr{^http://icanhaz\.com/.+},
< urlTea => qr{^http://urltea\.com/.+},
< BabyURL => qr{^http://babyurl\.com/.+},
< Linkz => qr{^http://lin\.kz/?\?.+},
< TinyClick => qr{^http://tinyclick\.com/?\?.+},
< V3 => qr{^http://\w+\.v3\.net/},
< ShortenURL => qr{^http://www\.shortenurl\.com/.+},
< URLjr => qr{^http://urljr\.com/.+},
< qURL => qr{^http://qurl\.net/.+},
< SmLnk => qr{^http://smlnk\.com/.+},
< ShortLink => qr{^http://shortlink\.us/.+},
< EkDk => qr{^http://add\.redir\.ek\.dk/.+},
< MakeAShorterLink => qr{^http://tinyurl\.com/.+},
< LinkToolbot => qr{^http://link\.toolbot\.com/.+},
< haojp => qr{^http://hao\.jp/.+},
< Smallr => qr{^http://smallr\.com/.+},
< unu => qr{^http://u\.nu/.+},
< Tinylink => [ qr{^http://tinylink\.com/.+}, 'Tinylink' ],
< durlme => qr{^http://durl\.me/.+},
< NotLong => qr{^http://[\w\-]+\.notlong\.com/?$},
< shadyurl => qr{^http://5z8\.info/.+},
< miudin => qr{^http://miud\.in/.+},
---
> icanhaz => qr{^https?://icanhaz\.com/.+},
> urlTea => qr{^https?://urltea\.com/.+},
> BabyURL => qr{^https?://babyurl\.com/.+},
> Linkz => qr{^https?://lin\.kz/?\?.+},
> TinyClick => qr{^https?://tinyclick\.com/?\?.+},
> V3 => qr{^https?://\w+\.v3\.net/},
> ShortenURL => qr{^https?://www\.shortenurl\.com/.+},
> URLjr => qr{^https?://urljr\.com/.+},
> qURL => qr{^https?://qurl\.net/.+},
> SmLnk => qr{^https?://smlnk\.com/.+},
> ShortLink => qr{^https?://shortlink\.us/.+},
> EkDk => qr{^https?://add\.redir\.ek\.dk/.+},
> MakeAShorterLink => qr{^https?://tinyurl\.com/.+},
> LinkToolbot => qr{^https?://link\.toolbot\.com/.+},
> haojp => qr{^https?://hao\.jp/.+},
> Smallr => qr{^https?://smallr\.com/.+},
> unu => qr{^https?://u\.nu/.+},
> Tinylink => [ qr{^https?://tinylink\.com/.+}, 'Tinylink' ],
> durlme => qr{^https?://durl\.me/.+},
> NotLong => qr{^https?://[\w\-]+\.notlong\.com/?$},
> shadyurl => qr{^https?://5z8\.info/.+},
> miudin => qr{^https?://miud\.in/.+},