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

1167Re: [soaplite] $My::SOAP::Transport::CGI::POST_MAX = 100 * 1024

Expand Messages
  • Duncan Cameron
    Jan 21, 2002
    • 0 Attachment
      Not sure that it need to be this complicated.
      Simply comparing $ENV{'CONTENT_LENGTH'} with the POST_MAX constant
      should be enough. The middle bit of the handle() method can be
      simplified to:

      $ENV{'REQUEST_METHOD'} || '' => $ENV{'SCRIPT_NAME'},
      HTTP::Headers->new(map {(/^HTTP_(.+)/i ? $1 : $_) => $ENV{$_}} keys %ENV)

      if ($POST_MAX &&
      ($POST_MAX >= 0 && $ENV{'CONTENT_LENGTH'} > $POST_MAX)) {
      $self->make_fault($SOAP::Constants::FAULT_CLIENT, "Your message is too long!")
      } else {
      read(STDIN,$content,$ENV{'CONTENT_LENGTH'} || 0);

      # carry on and do the printing to STDOUT

      Paul might be happy to make a change to the SOAP::Transport::HTTP::CGI
      class directly as it's so small.

      Duncan Cameron

      On 2002-01-21 aaron_of_montreal <aaron_of_montreal@...> wrote:
      >Hi all,
      >I spent a bit of time over the weekend looking through the code for
      >CGI-based SOAP servers for a way to implement a CGI.pm style POST_MAX
      >I ended up subclassing SOAP::Transport::HTTP::CGI and overriding the
      >handle method. I mention it in case anyone else has also been trying
      >to figure out how to do this.
      >Comments and suggestions would be appreciated. Cheers,
    • Show all 7 messages in this topic