]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - rounds/redirectHTML.go
go.stargrave.org/feeder is another feeder
[tofuproxy.git] / rounds / redirectHTML.go
index a5d4bd779f6e430b2008d12e1d6389c0d885b743..2e286d3208ba3da10ab100ac09fe466a98f8abe6 100644 (file)
@@ -44,8 +44,14 @@ var imageExts = map[string]struct{}{
        ".webp": {},
 }
 
-func isNewsboat(req *http.Request) bool {
-       return strings.Contains(req.Header.Get("User-Agent"), "newsboat/")
+func isFeeder(req *http.Request) bool {
+       if strings.Contains(req.Header.Get("User-Agent"), "newsboat/") {
+               return true
+       }
+       if strings.Contains(req.Header.Get("User-Agent"), "go.stargrave.org-feeder/") {
+               return true
+       }
+       return false
 }
 
 func RoundRedirectHTML(
@@ -62,7 +68,7 @@ func RoundRedirectHTML(
        case http.StatusMovedPermanently, http.StatusPermanentRedirect:
                redirType = "permanent"
        case http.StatusFound, http.StatusSeeOther, http.StatusTemporaryRedirect:
-               if isNewsboat(req) {
+               if isFeeder(req) {
                        return true, nil
                }
                if _, ok := imageExts[filepath.Ext(req.URL.Path)]; ok {