slightly simplify content-type check: just make sure XML is there

master
Wouter Groeneveld 8 months ago
parent f57a53e1b1
commit 9d08d35576
  1. 3
      .gitignore
  2. 16
      app/webmention/send/discoverer.go

3
.gitignore vendored

@ -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…
Cancel
Save