Browse Source

r.in.wms: check if getcapabilities()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37081 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 years ago
parent
commit
73471e585d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      scripts/r.in.wms/r.in.wms.py

+ 4 - 0
scripts/r.in.wms/r.in.wms.py

@@ -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: