Bug 1000230 - <condition/> is ignored in RewriteValve
Summary: <condition/> is ignored in RewriteValve
Keywords:
Status: CLOSED DUPLICATE of bug 969547
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Rémy Maucherat
QA Contact: Radim Hatlapatka
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-23 03:20 UTC by Hisanobu Okuda
Modified: 2018-12-02 15:59 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-23 07:35:24 UTC
Type: Bug


Attachments (Terms of Use)

Description Hisanobu Okuda 2013-08-23 03:20:29 UTC
Description of problem:
I configured web subsystem as follow:-

        <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <virtual-server name="default-host" enable-welcome-root="true">
                <alias name="localhost"/>
                <alias name="example.com"/>
		<access-log>
		  <directory relative-to="jboss.server.log.dir"/>
		</access-log>
                <rewrite pattern=".*" substitution="-" flags="F">
            	  <condition test="%{REQUEST_METHOD}" pattern="OPTIONS" flags="NC" />
    		</rewrite>

But <condition/> is ignored, as a result, EAP returns 403 for any HTTP mothods.

Version-Release number of selected component (if applicable):
EAP 6.1.0

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
EAP should return 403 for any methods (e.g., POST/GET/PUT/DELETE/TRACE/OPTIONS).

Expected results:
EAP should return 403 for OPTIONS method, and 200 for POST/GET methods.


Additional info:

Comment 1 Hisanobu Okuda 2013-08-23 03:22:27 UTC
The below works for me:-

[hokuda@localhost 00911259]$ diff -u WebVirtualHostAdd.java.org WebVirtualHostAdd.java
--- WebVirtualHostAdd.java.org  2013-05-09 13:06:56.000000000 +0900
+++ WebVirtualHostAdd.java      2013-08-23 11:58:05.330030629 +0900
@@ -163,13 +163,13 @@
         ModelNode result = new ModelNode();
         for (Property prop : unresolvedRewriteChildren.asPropertyList()) {
             ModelNode resolvedParent = resolveExpressions(context, prop.getValue(), WebReWriteDefinition.ATTRIBUTES);
-            result.get(prop.getName()).set(resolvedParent);
             if (prop.getValue().hasDefined(Constants.CONDITION)) {
                 for (Property conditionProp : prop.getValue().get(Constants.CONDITION).asPropertyList()) {
                     ModelNode resolvedCondition = resolveExpressions(context, conditionProp.getValue(), WebReWriteConditionDefinit
ion.ATTRIBUTES);                                                                                                                  
                     resolvedParent.get(Constants.CONDITION, conditionProp.getName()).set(resolvedCondition);
                 }
             }
+            result.get(prop.getName()).set(resolvedParent);
         }
         return result;
     }
[hokuda@localhost 00911259]$

Comment 2 Hisanobu Okuda 2013-08-23 03:23:21 UTC
Request for inclusion to EAP 6.2.0

Comment 3 Masafumi Miura 2013-08-23 07:32:15 UTC
Is this BZ duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=969547 ?

Comment 4 Hisanobu Okuda 2013-08-23 07:35:24 UTC

*** This bug has been marked as a duplicate of bug 969547 ***

Comment 5 Rostislav Svoboda 2013-08-28 08:51:43 UTC
Removing flags


Note You need to log in before you can comment on or make changes to this bug.