"net/http"
"os"
"os/exec"
+ "path/filepath"
"strings"
"time"
CmdDWebP = "dwebp"
CmdDJXL = "djxl"
+
+ imageExts = map[string]struct{}{
+ ".apng": {},
+ ".avif": {},
+ ".gif": {},
+ ".heic": {},
+ ".jp2": {},
+ ".jpeg": {},
+ ".jpg": {},
+ ".jxl": {},
+ ".mng": {},
+ ".png": {},
+ ".svg": {},
+ ".tif": {},
+ ".tiff": {},
+ ".webp": {},
+ }
)
func dialTLS(ctx context.Context, network, addr string) (net.Conn, error) {
if strings.Contains(req.Header.Get("User-Agent"), "newsboat/") {
goto NoRedir
}
+ if _, ok := imageExts[filepath.Ext(req.URL.Path)]; ok {
+ goto NoRedir
+ }
redirType = "temporary"
default:
goto NoRedir