comparison 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
comparison
equal deleted inserted replaced
366:1a2ef18e464d 367:7ecc4f8c895c
192 resp.Body = pr 192 resp.Body = pr
193 193
194 return nil 194 return nil
195 } 195 }
196 196
197 var xmlContentTypes = []string{
198 "application/xml",
199 "text/xml",
200 "application/gml+xml",
201 }
202
197 func isXML(h http.Header) bool { 203 func isXML(h http.Header) bool {
198 for _, t := range h["Content-Type"] { 204 for _, t := range h["Content-Type"] {
199 t = strings.ToLower(t) 205 t = strings.ToLower(t)
200 if strings.Contains(t, "text/xml") || 206 for _, ct := range xmlContentTypes {
201 strings.Contains(t, "application/xml") { 207 if strings.Contains(t, ct) {
202 return true 208 return true
209 }
203 } 210 }
204 } 211 }
205 return false 212 return false
206 } 213 }
207 214