[mapserver-users] Finding (and modifying?) status codes of mapserver responses

thomas bonfort thomas.bonfort at gmail.com
Wed Oct 19 09:25:50 PDT 2016


1. Yes, you'd need to hack it in yourself.
2. No idea... you'd be out of spec and that might be enough to break a
client. (I agree that the risk is low)

--
thomas

On Wed, Oct 19, 2016 at 6:08 PM deduikertjes <deduikertjes at xs4all.nl> wrote:

> Thomas,
>
> Thank you.
> Interesting remark you make on the WMS-spec. Never thought of that.
> You say that I can add a config option to return something other than 200.
> I suppose by that you mean that such a config option does not exits, but
> that I can hack it in?
>
> Can you please elaborate a bit on how non 200 status codes on service
> exception reports could break a client. No map is no map?
>
> Marco
>
>
>
> On 19-10-16 14:50, thomas bonfort wrote:
>
> Marco,
> It's the WMS spec itself that requires 200 response codes. You can hack
> the code or even add a configuration option to return something other than
> 200, but you'll risk breaking your clients. Also note that checking for
> specific text is not going to work all the time, as the client can request
> an "inimage" exception text, i.e. returned as pixels in a png image.
>
> --
> thomas
>
> On Wed, Oct 19, 2016 at 9:03 AM deduikertjes <DeDuikertjes at xs4all.nl>
> wrote:
>
> Finding and modifying status codes
>
> I'd like to find out (and maybe modify) the HTML status codes mapserver
> attaches to a WMS service exception report.
>
> I deploy mapserver behind Nginx with supervisord as a fastcgi provider and
> process manager. Nginx does caching of responses on getmap requests.
>
> As I don't want Service Exception reports to be cached I've added a
> directive to the Nginx config not to cache error documents containing
> 'serviceException'.
> This is not working properly, I think because nginx only regards a response
> as an error when a non-200 status code is attached.
>
> So I'm trying to find the status codes mapserver attaches to a response.
> If I do from command line mapserv7
> QUERY_STRING="map=my.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&....(rest
> of valid wms request)" I see the headers (and the png) when te request
> leads
> to a response containing a map.
> If I do the same with a request that generates an service exception report
> I
> get back error messages instead of the response I see in my browser.
>
> So, how to find out the headers of the response before it goes trough
> supervisord an nginx?
> Or does anyone know what status code the header contains?
> And the million dollar question: can we stick a 500 status code header on
> the response if it's not there?
>
> Any help greatly appreciated, MArco
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Finding-and-modifying-status-codes-of-mapserver-responses-tp5291371.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20161019/e0449599/attachment.htm>


More information about the MapServer-users mailing list