forked from wgroeneveld/go-jamming
slightly simplify content-type check: just make sure XML is there
This commit is contained in:
parent
f57a53e1b1
commit
9d08d35576
|
@ -16,4 +16,5 @@ go-jamming
|
|||
vangen
|
||||
|
||||
*.sublime-workspace
|
||||
.idea/*
|
||||
.idea/*
|
||||
__debug*
|
|
@ -26,24 +26,10 @@ var (
|
|||
"feed",
|
||||
"feed/index.xml",
|
||||
}
|
||||
|
||||
possibleContentTypes = []string{
|
||||
"application/rss+xml",
|
||||
"application/atom+xml",
|
||||
"application/xml",
|
||||
"text/xml",
|
||||
"application/rdf+xml",
|
||||
}
|
||||
)
|
||||
|
||||
func isContentTypeFeedCompatible(header http.Header) bool {
|
||||
cType := header.Get("Content-Type")
|
||||
for _, possibleType := range possibleContentTypes {
|
||||
if strings.Contains(cType, possibleType) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return strings.Contains(header.Get("Content-Type"), "xml")
|
||||
}
|
||||
|
||||
func (sndr *Sender) discoverRssFeed(domain string) (string, error) {
|
||||
|
|
Loading…
Reference in New Issue