Greetings,

Based on the thread here:

http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=117002875014012&w=2

I've put together a diff to make $r->the_request writeable. I've based this on the writeable test for $r->hostname. The test passes on my setup.

Any suggestions on changes to this, or should I go ahead and commit it?


Index: t/response/TestAPI/request_rec.pm
===================================================================
--- t/response/TestAPI/request_rec.pm   (revision 500867)
+++ t/response/TestAPI/request_rec.pm   (working copy)
@@ -24,7 +24,7 @@
 sub handler {
     my $r = shift;

-    plan $r, tests => 54;
+    plan $r, tests => 55;

#Apache2::RequestUtil->request($r); #PerlOptions +GlobalRequest takes care
     my $gr = Apache2::RequestUtil->request;
@@ -127,6 +127,13 @@
ok t_cmp $r->the_request, "GET $base_uri$path_info?$args HTTP/1.0",
             '$r->the_request';

+        {
+ my $new_request = "GET $base_uri$path_info?$args&foo=bar HTTP/1.0";
+            my $old_request = $r->the_request($new_request);
+            ok t_cmp $r->the_request, $new_request, '$r->the_request rw';
+            $r->the_request($old_request);
+        }
+
         ok $r->filename;

my $location = '/' . Apache::TestRequest::module2path(__PACKAGE__);
Index: docs/api/Apache2/RequestRec.pod
===================================================================
--- docs/api/Apache2/RequestRec.pod     (revision 500867)
+++ docs/api/Apache2/RequestRec.pod     (working copy)
@@ -1753,12 +1753,15 @@
 First HTTP request header

   $request = $r->the_request();
+  $old_request = $r->uri($new_request);

 =over 4

 =item obj: C<$r>
 ( C<L<Apache2::RequestRec object|docs::2.0::api::Apache2::RequestRec>> )

+=item opt arg1: C<$new_request> ( string )
+
 =item ret: C<$request> ( string )

 For example:
Index: xs/maps/apache2_structures.map
===================================================================
--- xs/maps/apache2_structures.map      (revision 500867)
+++ xs/maps/apache2_structures.map      (working copy)
@@ -12,7 +12,7 @@
 <  next
 <  prev
 <  main
-<  the_request
+   the_request
    assbackwards
 ~  proxyreq
 <  header_only

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to