mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-07-17 16:48:24 +00:00
Redirect links in search
This commit is contained in:
parent
5892445df7
commit
7467792ae9
@ -13,6 +13,10 @@ func HandleSearch(c *fiber.Ctx) error {
|
||||
|
||||
query := c.Query("q")
|
||||
|
||||
if utils.ImgurRe.MatchString(query) {
|
||||
return c.Redirect(utils.ImgurRe.ReplaceAllString(query, ""))
|
||||
}
|
||||
|
||||
/*page := "1"
|
||||
if c.Query("page") != "" {
|
||||
page = c.Query("page")
|
||||
|
5
utils/regex.go
Normal file
5
utils/regex.go
Normal file
@ -0,0 +1,5 @@
|
||||
package utils
|
||||
|
||||
import "regexp"
|
||||
|
||||
var ImgurRe = regexp.MustCompile(`https?://(i\.)?imgur\.com`)
|
Loading…
Reference in New Issue
Block a user