--jRHKVT23PllUwdXP
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

I'm trying to transform a not-really-HTTP request (first line containing
method differs) to HTTP using PerlTransHandler, like this:

sub Trans::handler {
my ($r) =3D @_;
my $method =3D $r->method;
if ($r->method eq 'FOO') {
$r->server->method_register($method);
$r->method('POST');
$r->filename(1);
$r->uri('/');
return Apache2::Const::OK;
}
return Apache2::Const:ECLINED;
}

So, if client sends "FOO blah whatever", I would like it to be changed
to "POST / HTTP/1.1".

But... this doesn't quite work. $r->protocol for these requests
contains "HTTP/0.9". The difference is: HTTP headers are neither
printed nor generated ($r->headers_out is empty).

Can I force HTTP/1.1 in PerlTransHandler somehow?
If not, can I force headers to be generated (without doing that manually)?
I've tried Apache2::SubRequest, but succeeded only with segfaults (after
$subreq->run).


My response handler:

sub Resp::handler {
my ($r) =3D @_;
warn $r->protocol;
$r->content_type("text/plain");
$r->status(200);
$r->print("foo\nbar\n");
return Apache2::Const::OK;
}

Configuration:

SetHandler modperl
PerlTransHandler Trans
PerlResponseHandler Resp


I know I could get it done using filters, but writing them is a pain...

--=20
Rados=C5=82aw Zieli=C5=84ski

--jRHKVT23PllUwdXP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)

iD8DBQFEzi3RvesRuUOywuARAkGpAKCmclUwLQIENJrFbswxt4 qFnCwrNQCff5E1
PSW3SSGUoXF6PmN9VQQIn4Y=
=WJfI
-----END PGP SIGNATURE-----

--jRHKVT23PllUwdXP--