[MapProxy] Missing Content-Type header in WMS source
A.Pirard.Papou
A.Pirard.Papou at gmail.com
Mon Oct 29 01:55:35 PDT 2012
On 2012-10-29 08:36, Oliver Tonnhofer wrote :
> On 28.10.2012, at 15:12, Magnus E wrote:
>> 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.
> There is no configuration option for that. But maybe MapProxy is checking too much in this case? I can change this check to only compare the Content-Type if it is present. Other parts of MapProxy already handle data that is not a valid image and MapProxy also checks for the HTTP status code (2xx).
Without a Content-Type, or rather a Mime-Type, the filename extension is
normally used.
With no extension either, Linux tests the magic (first) bytes of the
file against a type match.
See /*man file*/ for an extended description.
But, of course, the assumed type you requested is a perfect candidate.
If you want a double check, you may test the magic bytes or have the
/*file*/ command do it.
While waiting, Magnus might want to pipe the stream through a filter to
add the C-T line.
I met a problem following the links of StreamEdit below but there must
be other filters.
It probably takes less time building a patched mapproxy than to
elaborate that filter ;-)
Best regards,
André.
StreamEdit 1.0b2
<http://www.easyfreeware.com/streamedit-22043-freeware.html>
Advertisements:
\Intercept &\; modify TCP or UDP streams. StreamEdit is a utility
that allows you to modify a TCP 'stream' or UDP datagrams. It does this
by tunnelling the data through itself and then allow you to edit it
arbitrarly or use real-time filters. Those filters can modify the data
or trigger actions. The main purpose of StreamEdit is security analysis,
but it can serve many more. From protocol analysis to intrusion
detection testing, possibilities are endless.\
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20121029/36e85bc5/attachment.html>
More information about the MapProxy
mailing list