mirror of
https://github.com/makew0rld/amfora.git
synced 2024-09-27 23:05:55 -04:00
🐛 Detect feed for any XML file
This commit is contained in:
parent
2043ed7212
commit
8672b78d69
@ -115,7 +115,7 @@ func GetFeed(mediatype, filename string, r io.Reader) (*gofeed.Feed, bool) {
|
|||||||
// Check mediatype and filename
|
// Check mediatype and filename
|
||||||
if mediatype != "application/atom+xml" && mediatype != "application/rss+xml" && mediatype != "application/json+feed" &&
|
if mediatype != "application/atom+xml" && mediatype != "application/rss+xml" && mediatype != "application/json+feed" &&
|
||||||
filename != "atom.xml" && filename != "feed.xml" && filename != "feed.json" &&
|
filename != "atom.xml" && filename != "feed.xml" && filename != "feed.json" &&
|
||||||
!strings.HasSuffix(filename, ".atom") && !strings.HasSuffix(filename, ".rss") {
|
!strings.HasSuffix(filename, ".atom") && !strings.HasSuffix(filename, ".rss") && !strings.HasSuffix(filename, ".xml") {
|
||||||
// No part of the above is true
|
// No part of the above is true
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user