Bug 61681 - UnsupportedOperationException in ApplicationPushBuilder if request is forwarded
Summary: UnsupportedOperationException in ApplicationPushBuilder if request is forwarded
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-27 16:26 UTC by Michael Ernst
Modified: 2017-11-03 14:31 UTC (History)
1 user (show)



Attachments
maven example application with README.md (3.51 KB, application/x-zip-compressed)
2017-10-27 16:26 UTC, Michael Ernst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Ernst 2017-10-27 16:26:33 UTC
Created attachment 35473 [details]
maven example application with README.md

If the request is forwarded, it is not possible to create a ApplicationPushBuilder via the request object. I attached an example maven application which could be deployed to Tomcat 9.0.1 with enabled HTTP/2 support.

Stack:
```
java.lang.UnsupportedOperationException: Unable to find the underlying Coyote request object (which is required to create a push request) from the request of type [org.apache.catalina.connector.RequestFacade]
	org.example.PushFilter.doFilter(PushFilter.java:26)
	org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
	org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
	org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
	org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
	org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
```
Comment 1 Remy Maucherat 2017-11-02 16:04:51 UTC
It is pretty obvious in the code why it will not work (ApplicationHttpRequest.newPushBuilder uses this to create the push builder, not good), no test case needed here. However, even though I know how to fix it, I don't know yet how to do so without opening up holes or other problems.
Comment 2 Remy Maucherat 2017-11-03 14:31:56 UTC
This should be fixed in 9.0.2.