Mercurial > gemma
changeset 367:7ecc4f8c895c
Merge
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 09 Aug 2018 13:11:50 +0200 |
parents | 1a2ef18e464d (current diff) 765e056ab4e8 (diff) |
children | 78588014ad0a |
files | |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
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