git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37081 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -201,6 +201,10 @@ def list_layers():
except IOError:
grass.fatal("Unable to get capabilities of '%s'" % options['mapserver'])
+ # check DOCTYPE first
+ if cap_file.info()['content-type'] != 'application/vnd.ogc.wms_xml':
+ grass.fatal("Unable to get capabilities: %s" % url)
+
# parse file with sax
cap_xml = wms_parse.ProcessCapFile()
try: