Mercurial > gemma
diff controllers/externalwfs.go @ 367:7ecc4f8c895c
Merge
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 09 Aug 2018 13:11:50 +0200 |
parents | 765e056ab4e8 |
children | a43495c91856 |
line wrap: on
line diff
--- a/controllers/externalwfs.go Thu Aug 09 13:11:35 2018 +0200 +++ b/controllers/externalwfs.go Thu Aug 09 13:11:50 2018 +0200 @@ -194,12 +194,19 @@ return nil } +var xmlContentTypes = []string{ + "application/xml", + "text/xml", + "application/gml+xml", +} + func isXML(h http.Header) bool { for _, t := range h["Content-Type"] { t = strings.ToLower(t) - if strings.Contains(t, "text/xml") || - strings.Contains(t, "application/xml") { - return true + for _, ct := range xmlContentTypes { + if strings.Contains(t, ct) { + return true + } } } return false