ari-ban / issue-test

0 stars 0 forks source link

Unable to push arbitrary HTTP method #1902

Closed arinban closed 7 years ago

arinban commented 7 years ago

The Servlet 4.0 Push API allows setting the HTTP method for the push. It appears there is code in Grizzly to prevent this from happening.

Will attach reproducer.

arinban commented 6 years ago
arinban commented 7 years ago

@glassfishrobot Commented Reported by @edburns

arinban commented 7 years ago

@glassfishrobot Commented @edburns said:

Steps to reproduce

War approach

  1. Deploy the war
  2. Visit <https://localhost:8181/web-servlet-4.0-push-arbitrary-method/test> in Chrome, saying yes to the security prompt.
  3. Observe that the resource with a query string yields a 500.

Source code approach

  1. svn update your glassfish-appserv-tests trunk
  2. Apply the attached patch
  3. cd devtests/web and run ant edburns
  4. Observe the test fails.
arinban commented 7 years ago

@glassfishrobot Commented @edburns said: I observe the following in the log when trying to push with a method("foo").

[2017-04-03T21:45:11.375+0200] [glassfish 5.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=41 _ThreadName=http-listener-2(1)] [timeMillis: 1491248711375] [levelValue: 900] [[ StandardWrapperValve[test.TestServlet]: Servlet.service() for servlet test.TestServlet threw exception java.lang.IllegalArgumentException at org.glassfish.grizzly.http.server.http2.PushEvent$PushEventBuilder.method(PushEvent.java:213) at org.apache.catalina.core.ApplicationPushBuilder.push(ApplicationPushBuilder.java:362) at test.TestServlet.doGet(TestServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:686) at javax.servlet.http.HttpServlet.service(HttpServlet.java:791) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573) at java.lang.Thread.run(Thread.java:745) ]]

arinban commented 7 years ago

@glassfishrobot Commented @rlubke said: Changes applied: e319438c1016cb3d54ad6e18c116912db2640245

arinban commented 7 years ago

@glassfishrobot Commented File: 20170403-2047Z-GRIZZLY-1902-test.patch Attached By: @edburns

arinban commented 7 years ago

@glassfishrobot Commented File: web-servlet-4.0-push-arbitrary-method-web.war Attached By: @edburns

arinban commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GRIZZLY-1902

arinban commented 7 years ago

@glassfishrobot Commented Marked as fixed on Monday, April 3rd 2017, 1:05:52 pm