[jboss-jira] [JBoss JIRA] (WFLY-4204) Add predicate support for response-header filter

Dino Tsoumakis (JIRA) issues at jboss.org
Mon Dec 29 12:09:29 EST 2014


     [ https://issues.jboss.org/browse/WFLY-4204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dino Tsoumakis updated WFLY-4204:
---------------------------------
    Description: 
gzip filter has predicate support. response-header filter seems to ignore predicates.
It would be great to add predicate support to the response-header filter in the same way as it is working for gzip filter. Thus it would be possible to set response-header values dependent on other header values. This is interesting for setting a correct "Vary:" header value. 

If using predicate for filter-ref of a response-header filter request result in a 500 error producing the following stack trace in the log:
{code}
^[[0m^[[31m17:05:15,286 ERROR [io.undertow.request] (default I/O-1) Blocking request failed HttpServerExchange{ GET /}: java.lang.NullPointerException
        at java.util.regex.Matcher.getTextLength(Matcher.java:1283) [rt.jar:1.8.0_25]
        at java.util.regex.Matcher.reset(Matcher.java:309) [rt.jar:1.8.0_25]
        at java.util.regex.Matcher.<init>(Matcher.java:229) [rt.jar:1.8.0_25]
        at java.util.regex.Pattern.matcher(Pattern.java:1093) [rt.jar:1.8.0_25]
        at io.undertow.predicate.RegularExpressionPredicate.resolve(RegularExpressionPredicate.java:41)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:24)
        at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:66)
        at io.undertow.server.handlers.RequestLimit.handleRequest(RequestLimit.java:103)
        at io.undertow.server.handlers.RequestLimitingHandler.handleRequest(RequestLimitingHandler.java:81) 
        at io.undertow.server.handlers.NameVirtualHostHandler.handleRequest(NameVirtualHostHandler.java:57)
        at io.undertow.server.handlers.error.SimpleErrorPageHandler.handleRequest(SimpleErrorPageHandler.java:76)
        at io.undertow.server.handlers.CanonicalPathHandler.handleRequest(CanonicalPathHandler.java:43)
        at io.undertow.server.handlers.ChannelUpgradeHandler.handleRequest(ChannelUpgradeHandler.java:158)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
        at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:156)
        at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:91)
        at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:45)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.2.2.Final.jar:3.2.2.Final]
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) [xnio-api-3.2.2.Final.jar:3.2.2.Final] 
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87) [xnio-nio-3.2.2.Final.jar:3.2.2.Final]
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:539) [xnio-nio-3.2.2.Final.jar:3.2.2.Final]
{code}

  was:
gzip filter has predicate support. response-header filter seems to ignore predicates.
It would be great to add predicate support to the response-header filter in the same way as it is working for gzip filter. Thus it would be possible to set response-header values dependent on other header values. This is interesting for setting a correct "Vary:" header value. 



> Add predicate support for response-header filter
> ------------------------------------------------
>
>                 Key: WFLY-4204
>                 URL: https://issues.jboss.org/browse/WFLY-4204
>             Project: WildFly
>          Issue Type: Feature Request
>          Components: Web (Undertow)
>    Affects Versions: 8.2.0.Final
>            Reporter: Dino Tsoumakis
>            Assignee: Stuart Douglas
>            Priority: Minor
>
> gzip filter has predicate support. response-header filter seems to ignore predicates.
> It would be great to add predicate support to the response-header filter in the same way as it is working for gzip filter. Thus it would be possible to set response-header values dependent on other header values. This is interesting for setting a correct "Vary:" header value. 
> If using predicate for filter-ref of a response-header filter request result in a 500 error producing the following stack trace in the log:
> {code}
> ^[[0m^[[31m17:05:15,286 ERROR [io.undertow.request] (default I/O-1) Blocking request failed HttpServerExchange{ GET /}: java.lang.NullPointerException
>         at java.util.regex.Matcher.getTextLength(Matcher.java:1283) [rt.jar:1.8.0_25]
>         at java.util.regex.Matcher.reset(Matcher.java:309) [rt.jar:1.8.0_25]
>         at java.util.regex.Matcher.<init>(Matcher.java:229) [rt.jar:1.8.0_25]
>         at java.util.regex.Pattern.matcher(Pattern.java:1093) [rt.jar:1.8.0_25]
>         at io.undertow.predicate.RegularExpressionPredicate.resolve(RegularExpressionPredicate.java:41)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:24)
>         at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:66)
>         at io.undertow.server.handlers.RequestLimit.handleRequest(RequestLimit.java:103)
>         at io.undertow.server.handlers.RequestLimitingHandler.handleRequest(RequestLimitingHandler.java:81) 
>         at io.undertow.server.handlers.NameVirtualHostHandler.handleRequest(NameVirtualHostHandler.java:57)
>         at io.undertow.server.handlers.error.SimpleErrorPageHandler.handleRequest(SimpleErrorPageHandler.java:76)
>         at io.undertow.server.handlers.CanonicalPathHandler.handleRequest(CanonicalPathHandler.java:43)
>         at io.undertow.server.handlers.ChannelUpgradeHandler.handleRequest(ChannelUpgradeHandler.java:158)
>         at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
>         at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:156)
>         at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:91)
>         at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:45)
>         at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) [xnio-api-3.2.2.Final.jar:3.2.2.Final]
>         at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) [xnio-api-3.2.2.Final.jar:3.2.2.Final] 
>         at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87) [xnio-nio-3.2.2.Final.jar:3.2.2.Final]
>         at org.xnio.nio.WorkerThread.run(WorkerThread.java:539) [xnio-nio-3.2.2.Final.jar:3.2.2.Final]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list