improved imgur regex pattern as requested in #365

This commit is contained in:
Jean-Luc Tibaux 2022-11-26 20:22:01 +00:00
parent 45dc798eef
commit 50c369833b
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ module.exports = function(request, fs) {
* source: https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/src/config/config.json#L317
* license: GNU GPL v3 License -> https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/LICENSE
*/
let imgurRegex = /^https?:\/{2}([im]\.)?(stack\.)?imgur\.(com|io)/gm;
let imgurRegex = /(?<=href=")(https?:\/{2})([im]\.)?(stack\.)?imgur\.(com|io)(?=.+")/gm;
let protocol = config.https_enabled || config.api_force_https ? 'https://' : 'http://'