https://issues.apache.org/bugzilla/show_bug.cgi?id=51201
Bug #: 51201
Summary: Strange behavior REQUEST_METHOD & GET in mod_rewrite
Product: Apache httpd-2
Version: 2.2.15
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_rewrite
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
An example (or three), is worth a thousand words :-)
=== Test 1 === FAIL ==========================================
RewriteCond %{REQUEST_METHOD} !^(HEAD|POST|GET)$
RewriteRule (.*) - [L]
# Should not come here
RewriteRule ^/ http://test.localhost/?method=%{REQUEST_METHOD} [R=302,L]
=== Request Test 1:
NONE / HTTP/1.0
Accept: */*
Host: localhost
=== Response Test 1:
HTTP/1.1 302 Found
Date: Sun, 15 May 2011 14:21:34 GMT
Server: Apache
Location: http://test.localhost/?method=GET
Content-Length: 217
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a
href="http://test.localhost/?method=GET">here</a>.</p>
</body></html>
=== Test 2 === FAIL ==========================================
RewriteCond %{REQUEST_METHOD} !=HEAD
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_METHOD} !=GET
RewriteRule (.*) - [L]
# Should not come here
RewriteRule ^/ http://test.localhost/?method=%{REQUEST_METHOD} [R=302,L]
=== Request Test 2:
NONE / HTTP/1.0
Accept: */*
Host: localhost
=== Response Test 2:
HTTP/1.1 302 Found
Date: Sun, 15 May 2011 14:27:25 GMT
Server: Apache
Location: http://test.localhost/?method=GET
Content-Length: 217
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a
href="http://test.localhost/?method=GET">here</a>.</p>
</body></html>
=== Test 3 === OK ============================================
RewriteCond %{THE_REQUEST} !^(HEAD|POST|GET)
RewriteRule (.*) - [L]
# Should not come here
RewriteRule ^/ http://test.localhost/?method=%{REQUEST_METHOD} [R=302,L]
=== Request Test 3:
NONE / HTTP/1.0
Accept: */*
Host: localhost
=== Response Test 3:
HTTP/1.1 501 Method Not Implemented
Date: Sun, 15 May 2011 14:30:31 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 93
Connection: close
Content-Type: text/plain
ERROR-501 NOT_IMPLEMENTED
The server does not support the action requested by the browser.
============================================
This is a bug?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]