[MapProxy] Missing Content-Type header in WMS source

Magnus E magnus.account at gmail.com
Sun Oct 28 07:12:12 PDT 2012

I have been using Mapproxy 1.4 with mod_wsgi and Apache HTTP Server on my Windows machine for about a month and it has done a great job reprojecting different WMS sources from a local EPSG into GLOBAL_MERCATOR. Recently though I found a WMS source which Mapproxy cannot handle, probably since the Content-Type header is missing in the WMS server's response. 

These are the response headers from the WMS source (using Firefox with the HttpFox extension):
(Status-Line)    HTTP/1.1 200 OK
Server    Apache-Coyote/1.1
Transfer-Encoding    chunked
Date    Sun, 28 Oct 2012 12:35:39 GMT

And for reference, these are the response headers from another WMS source which works fine in Mapproxy:
(Status-Line)    HTTP/1.1 200 OK
Date    Sun, 28 Oct 2012 12:41:48 GMT
Server    Apache-Coyote/1.1
Cache-Control    max-age=7200, must-revalidate
Expires    Sun, 28 Oct 2012 14:41:40 GMT
geowebcache-tile-index    [2669, 1437, 13]
Content-Type    image/png
Content-Length    80140
Connection    close

Apart from the missing Content-Type header there is nothing wrong with the actual reponse from the WMS source. It serves the expected png tiles which I have verified by copying request urls from source-requests.log into the address field of my web browser, which displays the images correctly. Still, no layers are displayed in the Open Layers Client on the Mapproxy Demos page, and when I input the url to a tile that Mapproxy tries to serve (http://localhost/mapproxy/service?...) I get the following exception: 
<ServiceException>Could not get any sources: response from source WMS has no Content-type header</ServiceException>

Is there any way of telling Mapproxy explicitly that the incoming content is a png image? The only requests I make are for png images, so it probably wouldn't complicate matters if I let Mapproxy somehow assume that the source content is always a png image when the Content-Type header is missing.

I'm a basic user and no programmer but I can see that the ServiceException above is generated by wms.py in the client folder. To try to understand how Mapproxy makes requests and handles reponses I have looked at several of the .py files but it gets a bit overwhelming so I would be really grateful if someone could tell me if and how this problem could be solved.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20121028/378a436b/attachment.html>

More information about the MapProxy mailing list