Loading ...
Sorry, an error occurred while loading the content.

207 Multi-Status weirdness

Expand Messages
  • Kenneth van Grinsven
    Hi, I am currently writing some sort of proxy application, to proxy requests to outlook web access for added security. Now I have a problem with 207 status
    Message 1 of 2 , Feb 23, 2004
    • 0 Attachment
      Hi,

      I am currently writing some sort of proxy application, to proxy requests to outlook web access for added security.

      Now I have a problem with 207 status codes.
      Wheneven I set a 207 status code and some content, Apache still outputs an apache header at the end of the response.

      For example, my asp script is as follows:

      $Response->{Status} = "200";
      $Response->Write("Hello, world");

      Then apache sends to the browser (some headers skipped):
      +-+-+-+-+-+-+-+-+-+-+ cut here +-+-+-+-+-+-+-+-+-+-+
      HTTP/1.1 200 OK
      Date: Mon, 23 Feb 2004 13:39:20 GMT
      Server: Apache/1.3.29 (Unix) mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7c
      Content-Type: text/xml

      Hello, world
      +-+-+-+-+-+-+-+-+-+-+ cut here +-+-+-+-+-+-+-+-+-+-+

      However, when my script is as follows:
      # note the 207 status code
      $Response->{Status} = "207";
      $Response->Write("Hello, world");

      then apache sends to the browser (some headers skipped):
      +-+-+-+-+-+-+-+-+-+-+ cut here +-+-+-+-+-+-+-+-+-+-+
      HTTP/1.1 207 Multi-Status
      Date: Mon, 23 Feb 2004 13:39:20 GMT
      Server: Apache/1.3.29 (Unix) mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7c
      Content-Type: text/plain

      Hello, worldHTTP/1.1 207 Multi-Status
      Date: Mon, 23 Feb 2004 13:39:20 GMT
      Server: Apache/1.3.29 (Unix) mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7c
      Keep-Alive: timeout=15, max=99
      Content-Type: text/html; charset=iso-8859-1

      27a
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <HTML><HEAD>
      <TITLE>207 Multi-Status</TITLE>
      </HEAD><BODY>
      <H1>Multi-Status</H1>
      The server encountered an internal error or
      misconfiguration and was unable to complete
      your request.<P>
      Please contact the server administrator,
      root@... and inform them of the time the error occurred,
      and anything you might have done that may have
      caused the error.<P>
      More information about this error may be available
      in the server error log.<P>
      <P>Additionally, a 207 Multi-Status
      error was encountered while trying to use an ErrorDocument to handle the request.
      </BODY></HTML>

      0
      +-+-+-+-+-+-+-+-+-+-+ cut here +-+-+-+-+-+-+-+-+-+-+

      Indeed, apache just adds some sort or error document right after my output.

      I can't seem to switch of this behaviour. Maybe someone else has a clue?

      Kind regards,

      Kenneth van Grinsven
      --
      Userve Communications B.V.
      http://www.userve.nl


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... Apache::ASP passes back non-200 error codes to Apache during the request phase for normal error document handling. I believe this is what is helping cause
      Message 2 of 2 , Feb 25, 2004
      • 0 Attachment
        Kenneth van Grinsven wrote:
        > Hi,
        >
        > I am currently writing some sort of proxy application, to proxy requests to outlook web access for added security.
        >
        > Now I have a problem with 207 status codes.
        > Wheneven I set a 207 status code and some content, Apache still outputs an apache header at the end of the response.
        >
        > For example, my asp script is as follows:
        >
        > $Response->{Status} = "200";
        > $Response->Write("Hello, world");
        >

        Apache::ASP passes back non-200 error codes to Apache during the request phase
        for normal error document handling. I believe this is what is helping cause this problem.

        For now you might leave $Response->{Status} alone, and simply set

        Apache->request->status(207);

        Does this work for you? It may not. You might also try doing this...

        $Response->{Status} = 207;
        $Response->Flush; # send headers
        $Response->{Status} = 200; # so Apache::ASP returns no status code to Apache handler

        I would be interested to know if either of these work for you.
        There is some pending work to be released that allows for this type
        of funciontality better, but not sure exactly what form it will take.

        It may be something like:

        $Response->{Status} = 207;
        $Response->{ErrorDocument} = 0;

        or

        $Response->{Status} = 207;
        $Response->{CustomStatus} = 1;

        The latter methods, whichever occur, would become a formalized API to bypass the
        Apache error document method for handling non-200 statuses. Feedback/ideas would
        be appreciated. Meanwhile, the former hacks I might try for now, or alternatively,
        you might try writing a mod_perl handler directly.

        Regards,

        Josh

        ________________________________________________________________________
        Josh Chamas, Founder | NodeWorks - http://www.nodeworks.com
        Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
        http://www.chamas.com | Apache::ASP - http://www.apache-asp.org



        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.