[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapserver-users
Subject:    Re: [mapserver-users] Finding (and modifying?) status codes of mapserver responses
From:       thomas bonfort <thomas.bonfort () gmail ! com>
Date:       2016-10-19 16:25:50
Message-ID: CAOM3y2gv-aVfEXF3XQk50eStt4baeUpN6QHk6P_sRyYgbT2hRg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@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@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 
> 


[Attachment #5 (text/html)]

<div dir="ltr">1. Yes, you&#39;d need to hack it in yourself.<div>2. No idea... \
you&#39;d be out of spec and that might be enough to break a client. (I agree that \
the risk is low)</div><div><br></div><div>--</div><div>thomas</div></div><br><div \
class="gmail_quote"><div dir="ltr">On Wed, Oct 19, 2016 at 6:08 PM deduikertjes \
&lt;<a href="mailto:deduikertjes@xs4all.nl">deduikertjes@xs4all.nl</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">  
    
  
  <div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
    <div class="m_-1469345203110725706moz-cite-prefix gmail_msg">Thomas,<br \
class="gmail_msg">  <br class="gmail_msg">
      Thank you. <br class="gmail_msg">
      Interesting remark you make on the WMS-spec. Never thought of
      that.<br class="gmail_msg">
      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?<br class="gmail_msg">
      <br class="gmail_msg">
      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?<br \
class="gmail_msg">  <br class="gmail_msg">
      Marco</div></div><div bgcolor="#FFFFFF" text="#000000" class="gmail_msg"><div \
class="m_-1469345203110725706moz-cite-prefix gmail_msg"><br class="gmail_msg">  <br \
class="gmail_msg">  <br class="gmail_msg">
      On 19-10-16 14:50, thomas bonfort wrote:<br class="gmail_msg">
    </div></div><div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
    <blockquote type="cite" class="gmail_msg">
      <div dir="ltr" class="gmail_msg">Marco,
        <div class="gmail_msg">It&#39;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&#39;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
          &quot;inimage&quot; exception text, i.e. returned as pixels in a png
          image.</div>
        <div class="gmail_msg"><br class="gmail_msg">
        </div>
        <div class="gmail_msg">--</div>
        <div class="gmail_msg">thomas</div>
      </div>
      <br class="gmail_msg">
      <div class="gmail_quote gmail_msg">
        <div dir="ltr" class="gmail_msg">On Wed, Oct 19, 2016 at 9:03 AM deduikertjes \
&lt;<a href="mailto:DeDuikertjes@xs4all.nl" class="gmail_msg" \
target="_blank">DeDuikertjes@xs4all.nl</a>&gt;  wrote:<br class="gmail_msg">
        </div>
        <blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">Finding and  modifying status \
codes<br class="gmail_msg">  <br class="gmail_msg">
          I&#39;d like to find out (and maybe modify) the HTML status codes
          mapserver<br class="gmail_msg">
          attaches to a WMS service exception report.<br class="gmail_msg">
          <br class="gmail_msg">
          I deploy mapserver behind Nginx with supervisord as a fastcgi
          provider and<br class="gmail_msg">
          process manager. Nginx does caching of responses on getmap
          requests.<br class="gmail_msg">
          <br class="gmail_msg">
          As I don&#39;t want Service Exception reports to be cached I&#39;ve
          added a<br class="gmail_msg">
          directive to the Nginx config not to cache error documents
          containing<br class="gmail_msg">
          &#39;serviceException&#39;.<br class="gmail_msg">
          This is not working properly, I think because nginx only
          regards a response<br class="gmail_msg">
          as an error when a non-200 status code is attached.<br class="gmail_msg">
          <br class="gmail_msg">
          So I&#39;m trying to find the status codes mapserver attaches to a
          response.<br class="gmail_msg">
          If I do from command line mapserv7<br class="gmail_msg">
QUERY_STRING=&quot;map=my.map&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;....(rest<br \
                class="gmail_msg">
          of valid wms request)&quot; I see the headers (and the png) when te
          request leads<br class="gmail_msg">
          to a response containing a map.<br class="gmail_msg">
          If I do the same with a request that generates an service
          exception report I<br class="gmail_msg">
          get back error messages instead of the response I see in my
          browser.<br class="gmail_msg">
          <br class="gmail_msg">
          So, how to find out the headers of the response before it goes
          trough<br class="gmail_msg">
          supervisord an nginx?<br class="gmail_msg">
          Or does anyone know what status code the header contains?<br \
class="gmail_msg">  And the million dollar question: can we stick a 500 status
          code header on<br class="gmail_msg">
          the response if it&#39;s not there?<br class="gmail_msg">
          <br class="gmail_msg">
          Any help greatly appreciated, MArco<br class="gmail_msg">
          <br class="gmail_msg">
          <br class="gmail_msg">
          <br class="gmail_msg">
          --<br class="gmail_msg">
          View this message in context: <a \
href="http://osgeo-org.1560.x6.nabble.com/Finding-and-modifying-status-codes-of-mapserver-responses-tp5291371.html" \
rel="noreferrer" class="gmail_msg" \
target="_blank">http://osgeo-org.1560.x6.nabble.com/Finding-and-modifying-status-codes-of-mapserver-responses-tp5291371.html</a><br \
class="gmail_msg">  Sent from the Mapserver - User mailing list archive at
          Nabble.com.<br class="gmail_msg">
          _______________________________________________<br class="gmail_msg">
          mapserver-users mailing list<br class="gmail_msg">
          <a href="mailto:mapserver-users@lists.osgeo.org" class="gmail_msg" \
target="_blank">mapserver-users@lists.osgeo.org</a><br class="gmail_msg">  <a \
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" \
class="gmail_msg" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></blockquote>
  </div>
    </blockquote>
    <p class="gmail_msg"><br class="gmail_msg">
    </p>
  </div></blockquote></div>


[Attachment #6 (text/plain)]

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic