diff controllers/externalwfs.go @ 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 ac7e0f980456
children a43495c91856
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