2015-11-26 17:01 GMT+03:00 <ma...@apache.org>: > Author: markt > Date: Thu Nov 26 14:01:40 2015 > New Revision: 1716656 > > URL: http://svn.apache.org/viewvc?rev=1716656&view=rev > Log: > Implement a TODO. Trigger an exception if an HTTP upgrade is attempted over > AJP. > > Modified: > tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java > tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties > > Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1716656&r1=1716655&r2=1716656&view=diff > ============================================================================== > --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java > (original) > +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Thu Nov > 26 14:01:40 2015 > @@ -16,6 +16,7 @@ > */ > package org.apache.coyote.ajp; > > +import java.io.IOException; > import java.nio.ByteBuffer; > > import org.apache.coyote.AbstractProtocol; > @@ -171,8 +172,8 @@ public abstract class AbstractAjpProtoco > > @Override > protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket, > - ByteBuffer leftoverInput, UpgradeToken upgradeToken) { > - // TODO should fail - throw IOE > - return null; > + ByteBuffer leftoverInput, UpgradeToken upgradeToken) throws > IOException { > + throw new IOException(sm.getString("ajpprotocol.noUpgradeHandler", > + upgradeToken.getHttpUpgradeHandler().getClass().getName())); > } > } > > Modified: tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties?rev=1716656&r1=1716655&r2=1716656&view=diff > ============================================================================== > --- tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties (original) > +++ tomcat/trunk/java/org/apache/coyote/ajp/LocalStrings.properties Thu Nov > 26 14:01:40 2015 > @@ -14,6 +14,7 @@ > # limitations under the License. > ajpprotocol.noSSL=SSL is not supported with AJP. The SSL host configuration > for [{0}] was ignored > ajpprotocol.noUpgrade=Upgrade is not supported with AJP. The UpgradeProtocol > configuration for [{0}] was ignored > +ajpprotocol.noUpgradeHandler=Upgrade is not supported with AJP. The > HttpUpgradeHandler [{0}] can not be processed
Is this message just logged, or it is visible by an end user? I guess that it happens at early stages of processing, so a user receives an empty response page + some HTTP status code. I guess that it is not logged, as it can be triggered by end user and such messages usually are not logged by default (and in rare cases are logged with UserDataHelper's help). If such a message is visible by an end user, I have concern with it mentioning the protocol name (AJP): 1) It is confusing. An average user does not know what "AJP" is. 2) A user should not know what protocol is used by a proxy. I think maybe s/AJP/this protocol/. The actual protocol should be clear from stacktrace or thread name. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org