>>>>> "JB" == Jason Bodnar <[EMAIL PROTECTED]> writes:

JB> Can somebody tell me why Apache::Sandwich will only work with GET
JB> requests? I took a quick look at the code and am not picking it
JB> up. I'm guessing that the post parameters aren't set up for the
JB> subrequest and that's the problem?  Wouldn't it be as simple as
JB> setting the subr content to the original requests content after
JB> lookup_uri() is called?

Sounds plausible.  I never really put any thought into it, though.  I
just punted and manually sandwich my programs that need "POST" with a
function like this:

# insert header/footer parts for *.perl programs (like Sandwich module would)
# MUST RUN UNDER mod_perl ENVIRONMENT.
#
# $which is one of "HEADER" or "FOOTER".
# Use PerlSetVar in httpd.conf to set these values.
sub insert_document_parts ($) {
  my ($which) = @_;

  my $r = Apache->request;

  my(@parts) = split /\s+/, $r->dir_config($which);
  for my $uri (@parts) {
#    warn "inserting $uri " . $r->method() . "\n";
    my $status = Apache::Include->virtual($uri, $r) if $uri;

    #bail if we fail!
    return $status unless $status == DOCUMENT_FOLLOWS; 
  }

  return 0;
}

Then in the program, I call insert_document_parts("HEADER") at the
top, and insert_document_parts("FOOTER") at the bottom.  One day I
might actually stick this function into Sandwich.pm, as it is
basically stolen from there anyhow.

Reply via email to