ASP4-PSGI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


2012-02-01    v0.004
  - Now if you have a '/404.asp' we will try to call it if we get a 404 error.

2011-12-12    v0.003
  - Now compatible with more recent versions of ASP4.

2010-09-21    v0.002
  - Woops!  Was not returning a coderef.  Now we are.

2010-09-21    v0.001
  - Initial version.
  - Tested with Plack, Corona and Starman.

lib/ASP4/PSGI.pm  view on Meta::CPAN

          $api->ua->upload( $env->{REQUEST_URI}, \@pairs );
        }
        else
        {
          # POST:
          $api->ua->post( $env->{REQUEST_URI}, [ $preq->parameters->flatten ] );
        }# end if()
      }# end if()
    };
    
    # Check for a 404 response.  If we got one, then see if we've got a /404.asp:
    my ($status) = $res->status_line =~ m{^(\d+)};
    if( $status eq 404 && -f $api->config->web->www_root . '/404.asp' )
    {
      # Try to do the right thing:
      $res = $api->ua->get( '/404.asp' );
    }# end if()
    
    # Return a PSGI-compliant response:
    return [
      $status,
      [
        %{ $res->headers }
      ],
      [
        $res->content



( run in 0.649 second using v1.01-cache-2.11-cpan-39bf76dae61 )