This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1000230 - <condition/> is ignored in RewriteValve
<condition/> is ignored in RewriteValve
Status: CLOSED DUPLICATE of bug 969547
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Rémy Maucherat
Radim Hatlapatka
Russell Dickenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 23:20 EDT by Hisanobu Okuda
Modified: 2013-08-28 04:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-23 03:35:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hisanobu Okuda 2013-08-22 23:20:29 EDT
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-22 23:22:27 EDT
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-22 23:23:21 EDT
Request for inclusion to EAP 6.2.0
Comment 3 Masafumi Miura 2013-08-23 03:32:15 EDT
Is this BZ duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=969547 ?
Comment 4 Hisanobu Okuda 2013-08-23 03:35:24 EDT

*** This bug has been marked as a duplicate of bug 969547 ***
Comment 5 Rostislav Svoboda 2013-08-28 04:51:43 EDT
Removing flags

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