ASF Bugzilla – Attachment 37523 Details for
Bug 64785
allowmethods should be able to disable individual methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
mod_allowmethods tests
file_64785.txt (text/plain), 2.73 KB, created by
Marcel Montes
on 2020-10-22 01:40:40 UTC
(
hide
)
Description:
mod_allowmethods tests
Filename:
MIME Type:
Creator:
Marcel Montes
Created:
2020-10-22 01:40:40 UTC
Size:
2.73 KB
patch
obsolete
>Index: t/conf/extra.conf.in >=================================================================== >--- t/conf/extra.conf.in (revision 1882461) >+++ t/conf/extra.conf.in (working copy) >@@ -1333,9 +1333,18 @@ > <Directory @SERVERROOT@/htdocs/modules/allowmethods> > Options +Indexes > </Directory> >+ <Directory @SERVERROOT@/htdocs/modules/allowmethods/NoPost> >+ AllowMethods -POST >+ </Directory> > <Directory @SERVERROOT@/htdocs/modules/allowmethods/Get> > AllowMethods GET > </Directory> >+ <Directory @SERVERROOT@/htdocs/modules/allowmethods/Get/post> >+ AllowMethods +POST >+ </Directory> >+ <Directory @SERVERROOT@/htdocs/modules/allowmethods/Get/none> >+ AllowMethods -GET >+ </Directory> > <Directory @SERVERROOT@/htdocs/modules/allowmethods/Head> > AllowMethods HEAD > </Directory> >Index: t/htdocs/modules/allowmethods/Get/none/.empty >=================================================================== >Index: t/htdocs/modules/allowmethods/Get/post/foo.txt >=================================================================== >Index: t/htdocs/modules/allowmethods/NoPost/.empty >=================================================================== >Index: t/modules/allowmethods.t >=================================================================== >--- t/modules/allowmethods.t (revision 1882461) >+++ t/modules/allowmethods.t (working copy) >@@ -9,6 +9,7 @@ > my $get = "Get"; > my $head = "Head"; > my $post = "Post"; >+my $options = "Options"; > > ## > ## mod_allowmethods test >@@ -15,6 +16,9 @@ > ## > my @test_cases = ( > [ $get, $get, 200 ], >+ [ $get, "NoPost", 200 ], >+ [ $post, "NoPost", 405 ], >+ [ $options, "NoPost" , 200 ], > [ $head, $get, 200 ], > [ $post, $get, 405 ], > [ $get, $head, 200 ], >@@ -24,6 +28,10 @@ > [ $head, $post, 405 ], > [ $post, $post, 200 ], > [ $get, $post . '/reset', 200 ], >+ [ $post, $get . '/post', 200 ], >+ [ $get, $get . '/post', 200 ], >+ [ $options, $get . '/post', 405 ], >+ [ $get, $get . '/none', 405 ], > ); > > plan tests => (scalar @test_cases), have_module 'allowmethods'; >@@ -30,7 +38,7 @@ > > foreach my $case (@test_cases) { > my ($fct, $allowed, $rc) = @{$case}; >- >+ > if ($fct eq $get) { > $r = GET('/modules/allowmethods/' . $allowed . '/'); > } >@@ -40,7 +48,10 @@ > elsif ($fct eq $post) { > $r = POST('/modules/allowmethods/' . $allowed . '/foo.txt'); > } >+ elsif ($fct eq $options) { >+ $r = OPTIONS('/modules/allowmethods/' . $allowed . '/'); >+ } > >- ok t_cmp($r->code, $rc, $fct . " - When " . $allowed . " is allowed."); >+ ok t_cmp($r->code, $rc, "$fct request to /$allowed responds $rc"); > } >- >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 64785
:
37484
|
37490
|
37491
|
37495
|
37497
|
37500
|
37501
| 37523