[GitHub] tomcat-maven-plugin pull request #27: Handle failed tomcat war deployment (s...
GitHub user laurentperez opened a pull request: https://github.com/apache/tomcat-maven-plugin/pull/27 Handle failed tomcat war deployment (status OK but body FAIL) per http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html a failed deploy will trigger a body with status code 200 but with body response starting with FAIL (i18n) this patch adds the FAIL body response handler for en/fr languages unsure if tests are really needed (?) You can merge this pull request into a Git repository by running: $ git pull https://github.com/laurentperez/tomcat-maven-plugin trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tomcat-maven-plugin/pull/27.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #27 commit 153af9a3e076a85578eca829d06c2044d4fe2a34 Author: lperez Date: 2017-05-24T10:36:50Z handle failed tomcat war deployment --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1796054 - in /tomcat/trunk: java/javax/servlet/http/ java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ java/org/apache
Author: markt Date: Wed May 24 13:00:47 2017 New Revision: 1796054 URL: http://svn.apache.org/viewvc?rev=1796054&view=rev Log: Servlet 4.0 Update API and implementation for reading trailer fields from the request Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java tomcat/trunk/java/org/apache/coyote/ActionCode.java tomcat/trunk/java/org/apache/coyote/Request.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java tomcat/trunk/java/org/apache/coyote/http2/Stream.java tomcat/trunk/java/org/apache/coyote/http2/StreamProcessor.java tomcat/trunk/java/org/apache/coyote/http2/StreamStateMachine.java tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=1796054&r1=1796053&r2=1796054&view=diff == --- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Wed May 24 13:00:47 2017 @@ -590,4 +590,23 @@ public interface HttpServletRequest exte public default Map getTrailerFields() { return Collections.emptyMap(); } + +/** + * Are trailer fields ready to be read (there may still be no trailers to + * read). This method always returns {@code true} if the underlying protocol + * does not support trailer fields. Otherwise, {@code true} is returned once + * all of the following are true: + * + * The application has ready all the request data and an EOF has been + * received or the content-length is zero + * All trailer fields, if any, have been received + * + * + * @return {@code true} if trailers are ready to be read + * + * @since Servlet 4.0 + */ +public default boolean isTrailerFieldsReady() { +return false; +} } Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=1796054&r1=1796053&r2=1796054&view=diff == --- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Wed May 24 13:00:47 2017 @@ -389,7 +389,8 @@ public class HttpServletRequestWrapper e * {@inheritDoc} * * The default behavior of this method is to return - * {@link HttpServletRequest#newPushBuilder()} on the wrapped request object. + * {@link HttpServletRequest#newPushBuilder()} on the wrapped request + * object. * * @since Servlet 4.0 */ @@ -402,7 +403,8 @@ public class HttpServletRequestWrapper e * {@inheritDoc} * * The default behavior of this method is to return - * {@link HttpServletRequest#getTrailerFields()} on the wrapped request object. + * {@link HttpServletRequest#getTrailerFields()} on the wrapped request + * object. * * @since Servlet 4.0 */ @@ -410,4 +412,19 @@ public class HttpServletRequestWrapper e public Map getTrailerFields() { return this._getHttpServletRequest().getTrailerFields(); } + + +/** + * {@inheritDoc} + * + * The default behavior of this method is to return + * {@link HttpServletRequest#isTrailerFieldsReady()} on the wrapped request + * object. + * + * @since Servlet 4.0 + */ +@Override +public boolean isTrailerFieldsReady() { +return this._getHttpServletRequest().isTrailerFieldsReady(); +} } Modified: tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1796054&r1=1796053&r2=1796054&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Wed May 24 13:00:47 2017 @@ -56,6 +56,7 @@ coyoteRequest.filterAsyncSupportUnknown= coyoteRequest.maxPostSizeExceeded=The multi-part request contained parameter data (excluding uploaded files) that exceeded the
[Bug 61120] New: Tomcat 8.5.15 with HTTP/2: URL path parameters lost
https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 Bug ID: 61120 Summary: Tomcat 8.5.15 with HTTP/2: URL path parameters lost Product: Tomcat 8 Version: 8.5.15 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Connectors Assignee: dev@tomcat.apache.org Reporter: markus.doerschm...@gmx.de Target Milestone: When using Tomcat 8.5.15 with HTTP/2 all URL path parameters gets lost. In some cases, session tracking is done via URL (yes, I know, doing that is bad ;)). Using the HTTP/2 protocol, the URL contains the "jsessionid" parameter, but Tomcat creates a new session. It seems, the session ID never reaches the session manager. I configured a connector using NIO2 in combination with Http2Protocol: Using the same connector without everything is okay. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 61120] Tomcat 8.5.15 with HTTP/2: URL path parameters lost
https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 Markus Dörschmidt changed: What|Removed |Added CC||markus.doerschm...@gmx.de -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1796080 - in /tomcat/trunk/java/org/apache/coyote: AbstractProcessor.java ActionCode.java Request.java
Author: markt Date: Wed May 24 16:59:35 2017 New Revision: 1796080 URL: http://svn.apache.org/viewvc?rev=1796080&view=rev Log: Consistent naming Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java tomcat/trunk/java/org/apache/coyote/ActionCode.java tomcat/trunk/java/org/apache/coyote/Request.java Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1796080&r1=1796079&r2=1796080&view=diff == --- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Wed May 24 16:59:35 2017 @@ -487,7 +487,7 @@ public abstract class AbstractProcessor } // Servlet 4.0 Trailers -case TRAILER_FIELDS_READY: { +case IS_TRAILER_FIELDS_READY: { AtomicBoolean result = (AtomicBoolean) param; result.set(isTrailerFieldsReady()); break; Modified: tomcat/trunk/java/org/apache/coyote/ActionCode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ActionCode.java?rev=1796080&r1=1796079&r2=1796080&view=diff == --- tomcat/trunk/java/org/apache/coyote/ActionCode.java (original) +++ tomcat/trunk/java/org/apache/coyote/ActionCode.java Wed May 24 16:59:35 2017 @@ -252,5 +252,5 @@ public enum ActionCode { * true if it is known that request trailer fields are not supported so an * empty collection of trailers can then be read. */ -TRAILER_FIELDS_READY +IS_TRAILER_FIELDS_READY } Modified: tomcat/trunk/java/org/apache/coyote/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Request.java?rev=1796080&r1=1796079&r2=1796080&view=diff == --- tomcat/trunk/java/org/apache/coyote/Request.java (original) +++ tomcat/trunk/java/org/apache/coyote/Request.java Wed May 24 16:59:35 2017 @@ -199,7 +199,7 @@ public final class Request { public boolean isTrailerFieldsReady() { AtomicBoolean result = new AtomicBoolean(false); -action(ActionCode.TRAILER_FIELDS_READY, result); +action(ActionCode.IS_TRAILER_FIELDS_READY, result); return result.get(); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1796090 - in /tomcat/trunk: java/org/apache/coyote/http2/Stream.java test/org/apache/coyote/http2/TestStream.java webapps/docs/changelog.xml
Author: markt Date: Wed May 24 19:35:00 2017 New Revision: 1796090 URL: http://svn.apache.org/viewvc?rev=1796090&view=rev Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 Do not ignore path parameters when processing HTTP/2 requests. Added: tomcat/trunk/test/org/apache/coyote/http2/TestStream.java (with props) Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1796090&r1=1796089&r2=1796090&view=diff == --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Wed May 24 19:35:00 2017 @@ -18,6 +18,7 @@ package org.apache.coyote.http2; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -299,18 +300,18 @@ class Stream extends AbstractStream impl getConnectionId(), getIdentifier())); } int queryStart = value.indexOf('?'); +String uri; if (queryStart == -1) { -coyoteRequest.requestURI().setString(value); -coyoteRequest.decodedURI().setString( -coyoteRequest.getURLDecoder().convert(value, false)); +uri = value; } else { -String uri = value.substring(0, queryStart); +uri = value.substring(0, queryStart); String query = value.substring(queryStart + 1); -coyoteRequest.requestURI().setString(uri); -coyoteRequest.decodedURI().setString( -coyoteRequest.getURLDecoder().convert(uri, false)); coyoteRequest.queryString().setString(query); } +// Bug 61120. Set the URI as bytes rather than String so any path +// parameters are correctly processed +byte[] uriBytes = uri.getBytes(StandardCharsets.ISO_8859_1); +coyoteRequest.requestURI().setBytes(uriBytes, 0, uriBytes.length); break; } case ":authority": { Added: tomcat/trunk/test/org/apache/coyote/http2/TestStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestStream.java?rev=1796090&view=auto == --- tomcat/trunk/test/org/apache/coyote/http2/TestStream.java (added) +++ tomcat/trunk/test/org/apache/coyote/http2/TestStream.java Wed May 24 19:35:00 2017 @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.coyote.http2; + +import java.io.IOException; +import java.nio.ByteBuffer; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.junit.Assert; +import org.junit.Test; + +import org.apache.catalina.Context; +import org.apache.catalina.startup.Tomcat; + +public class TestStream extends Http2TestBase { + +/* + * https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 + */ +@Test +public void testPathParam() throws Exception { + +enableHttp2(); + +Tomcat tomcat = getTomcatInstance(); + +Context ctxt = tomcat.addContext("", null); +Tomcat.addServlet(ctxt, "simple", new SimpleServlet()); +ctxt.addServletMappingDecoded("/simple", "simple"); +Tomcat.addServlet(ctxt, "pathparam", new PathParam()); +ctxt.addServletMappingDecoded("/pathparam", "pathparam"); + +tomcat.start(); + +openClientConnection(); +doHttpUpgrade(); +sendClientPreface(); +validateHttp2InitialResponse(); + +byte[] frameHeader = new byte[9]; +ByteBuffer headersPayload = ByteBuffer.allocate(128); +buildGe
svn commit: r1796091 - in /tomcat/tc8.5.x/trunk: ./ java/org/apache/coyote/http2/Stream.java test/org/apache/coyote/http2/TestStream.java webapps/docs/changelog.xml
Author: markt Date: Wed May 24 19:36:12 2017 New Revision: 1796091 URL: http://svn.apache.org/viewvc?rev=1796091&view=rev Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 Do not ignore path parameters when processing HTTP/2 requests. Added: tomcat/tc8.5.x/trunk/test/org/apache/coyote/http2/TestStream.java - copied unchanged from r1796090, tomcat/trunk/test/org/apache/coyote/http2/TestStream.java Modified: tomcat/tc8.5.x/trunk/ (props changed) tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc8.5.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Wed May 24 19:36:12 2017 @@ -1 +1 @@ -/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409,1741501 ,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745535,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747404,1747506,1747 536,1747924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1756289,1756408-1 756410,1756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757790,1757799,1757813,1757853,1757883,1757903,1757976,1757997,1758000,1758058,1758072-1758075,1758078-1758079,1758223,1758257,1758261,1758276,1758292,1758369,1758378-1758383,1758421,1758423,1758425-1758427,1758430,1758443,1758448,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758580,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1759757,1759785-1759790,1760005,1760022,1760109-1760110,1760135,1760200-1760201,1760227,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762051-1762053,1762123,176216 8,1762172,1762182,1762201-1762202,1762204,1762208,1762288,1762296,1762324,1762348,1762353,1762362,1762374,1762492,1762503,1762505,1762541,1762608,1762710,1762753,1762766,1762769,1762944,1762947,1762953,1
[Bug 61120] Tomcat 8.5.15 with HTTP/2: URL path parameters lost
https://bz.apache.org/bugzilla/show_bug.cgi?id=61120 Mark Thomas changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #1 from Mark Thomas --- Thanks for the report. This has been fixed in: - 9.0.x for 9.0.0.M22 - 8.5.x for 8.5.16 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org