Mercurial > gemma
changeset 365:765e056ab4e8
Recognize more XML content types in WFS proxy.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 09 Aug 2018 11:44:58 +0200 |
parents | c63200982ce7 |
children | 7ecc4f8c895c |
files | controllers/externalwfs.go |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/controllers/externalwfs.go Thu Aug 09 10:13:09 2018 +0200 +++ b/controllers/externalwfs.go Thu Aug 09 11:44:58 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