Commit 33d727da authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 8.5.15

parent 2fab3605
......@@ -35,7 +35,7 @@ source distribution, do the following:
1. If the JDK is already installed, skip to (2).
2. Download a version 8 of Java Development Kit (JDK) release (use the
2. Download a version 7 of Java Development Kit (JDK) release (use the
latest update available for your chosen version) from one of:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
......@@ -397,6 +397,12 @@ For example:
test.name=**/TestSsl.java,**/TestWebSocketFrameClientSSL.java
You can exclude specific JUnit test classes by adding the "test.exclude"
property to the build.properties file. The property specifies an Ant
excludes pattern for the fileset of test class files to exclude form the run.
The default value is empty, so no classes are excluded. The syntax is the same
as for the property "test.name".
(7.4) Other configuration options
......
......@@ -25,7 +25,7 @@
# ----- Version Control Flags -----
version.major=8
version.minor=5
version.build=14
version.build=15
version.patch=0
version.suffix=
......@@ -117,8 +117,8 @@ wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar
# ----- Eclipse JDT, version 4.5.1 or later -----#
# See https://wiki.apache.org/tomcat/JDTCoreBatchCompiler before updating
jdt.version=4.6.1
jdt.release=R-4.6.1-201609071200
jdt.version=4.6.3
jdt.release=R-4.6.3-201703010400
jdt.home=${base.path}/ecj-${jdt.version}
jdt.jar=${jdt.home}/ecj-${jdt.version}.jar
# The download will be moved to the archive area eventually. We are taking care of that in advance.
......
......@@ -1470,6 +1470,8 @@
<exclude name="org/apache/tomcat/util/net/openssl/ciphers/**" unless="${test.openssl.exists}" />
<!-- Exclude performance tests. E.g. on systems with slow/inconsistent timing -->
<exclude name="**/*Performance.java" if="${test.excludePerformance}" />
<!-- Exclude a configurable list of tests -->
<exclude name="${test.exclude}" />
</fileset>
</batchtest>
</junit>
......
......@@ -4309,6 +4309,10 @@
<extension>woff</extension>
<mime-type>application/x-font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff2</extension>
<mime-type>font/woff2</mime-type>
</mime-mapping>
<mime-mapping>
<extension>wpd</extension>
<mime-type>application/vnd.wordperfect</mime-type>
......
......@@ -171,13 +171,14 @@ public abstract class ExpressionFactory {
}
}
if (constructor == null) {
result = (ExpressionFactory) clazz.newInstance();
result = (ExpressionFactory) clazz.getConstructor().newInstance();
} else {
result =
(ExpressionFactory) constructor.newInstance(properties);
}
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException e) {
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException |
NoSuchMethodException e) {
throw new ELException(
"Unable to create ExpressionFactory of type: " + clazz.getName(),
e);
......
......@@ -152,7 +152,7 @@ public class ImportHandler {
if (className != null) {
Class<?> clazz = findClass(className, true);
if (clazz != null) {
clazzes.put(className, clazz);
clazzes.put(name, clazz);
return clazz;
}
}
......
......@@ -16,11 +16,11 @@
# Default localized string information
# Localized for Locale en_US
propertyNotFound=Property ''{1}'' not found on type {0}
propertyNotReadable=Property ''{1}'' not readable on type {0}
propertyNotWritable=Property ''{1}'' not writable on type {0}
propertyReadError=Error reading ''{1}'' on type {0}
propertyWriteError=Error writing ''{1}'' on type {0}
propertyNotFound=Property [{1}] not found on type [{0}]
propertyNotReadable=Property [{1}] not readable on type [{0}]
propertyNotWritable=Property [{1}] not writable on type [{0}]
propertyReadError=Error reading [{1}] on type [{0}]
propertyWriteError=Error writing [{1}] on type [{0}]
objectNotAssignable=Unable to add an object of type [{0}] to an array of objects of type [{1}]
beanNameELResolver.beanReadOnly=The bean name [{0}] is read-only
......
......@@ -12,9 +12,9 @@
# 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.
propertyNotFound = Propiedad ''{1}'' no hallada en el tipo {0}
propertyNotReadable = Propiedad ''{1}'' no legible para el tipo {0}
propertyNotWritable = Propiedad ''{1}'' no grabable para el tipo {0}
propertyReadError = Error reading ''{1}'' en el tipo {0}
propertyWriteError = Error writing ''{1}'' en el tipo {0}
propertyNotFound = Propiedad [{1}] no hallada en el tipo [{0}]
propertyNotReadable = Propiedad [{1}] no legible para el tipo [{0}]
propertyNotWritable = Propiedad [{1}] no grabable para el tipo [{0}]
propertyReadError = Error reading [{1}] en el tipo [{0}]
propertyWriteError = Error writing [{1}] en el tipo [{0}]
objectNotAssignable = No puedo a\u00F1adir un objeto del tipo [{0}] a un arreglo de objetos del tipo [{1}]
......@@ -16,6 +16,7 @@
*/
package javax.security.auth.message.config;
import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.Permission;
import java.security.PrivilegedAction;
......@@ -65,13 +66,14 @@ public abstract class AuthConfigFactory {
new PrivilegedExceptionAction<AuthConfigFactory>() {
@Override
public AuthConfigFactory run() throws ClassNotFoundException,
InstantiationException, IllegalAccessException {
InstantiationException, IllegalAccessException, IllegalArgumentException,
InvocationTargetException, NoSuchMethodException, SecurityException {
// Load this class with the same class loader as used for
// this class. Note that the Thread context class loader
// should not be used since that would trigger a memory leak
// in container environments.
Class<?> clazz = Class.forName(className);
return (AuthConfigFactory) clazz.newInstance();
return (AuthConfigFactory) clazz.getConstructor().newInstance();
}
});
} catch (PrivilegedActionException e) {
......
......@@ -16,7 +16,7 @@
# Default localized string information
# Localized for Locale en_US
err.not_iso8859_1=Not an ISO 8859-1 character: {0}
err.not_iso8859_1=Not an ISO 8859-1 character: [{0}]
value.true=true
value.false=false
......
......@@ -12,7 +12,7 @@
# 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.
err.not_iso8859_1 = No es un car\u00E1cter ISO 8859-1\: {0}
err.not_iso8859_1 = No es un car\u00E1cter ISO 8859-1: [{0}]
value.true = true
value.false = false
httpConstraintElement.invalidRolesDeny = No se pueden especificar Roles al utilizar DENY (DENEGAR)
......
......@@ -16,7 +16,7 @@
# Default localized string information
# Localized for Locale fr_FR
err.not_iso8859_1={0} n''est pas un caract\u00e8re ISO 8859-1
err.not_iso8859_1=[{0}] n''est pas un caract\u00e8re ISO 8859-1
value.true=true
value.false=false
......
......@@ -16,6 +16,6 @@
# Default localized string information
# Localized for Locale ja_JP
err.not_iso8859_1=ISO 8859-1 \u306e\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093: {0}
err.not_iso8859_1=ISO 8859-1 \u306e\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093: [{0}]
value.true=true
value.false=false
......@@ -16,13 +16,13 @@
# Default localized string information
# Localized for Locale en_US
err.cookie_name_is_token=Cookie name \"{0}\" is a reserved token
err.cookie_name_is_token=Cookie name [{0}] is a reserved token
err.cookie_name_blank=Cookie name may not be null or zero length
err.io.nullArray=Null passed for byte array in write method
err.io.indexOutOfBounds=Invalid offset [{0}] and / or length [{1}] specified for array of size [{2}]
err.io.short_read=Short Read
http.method_not_implemented=Method {0} is not implemented by this servlet for this URI
http.method_not_implemented=Method [{0}] is not implemented by this servlet for this URI
http.method_get_not_supported=HTTP method GET is not supported by this URL
http.method_post_not_supported=HTTP method POST is not supported by this URL
......
......@@ -12,11 +12,11 @@
# 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.
err.cookie_name_is_token = El nombre de Cookie {0} es una palabra reservada
err.cookie_name_is_token = El nombre de Cookie [{0}] es una palabra reservada
err.cookie_name_blank = El nombre del Cookie no puede ser nulo o de longitud cero
err.io.negativelength = Longitud Negativa en el metodo write
err.io.short_read = Lectura Corta
http.method_not_implemented = El Metodo {0} no esta implementado por este servlet para esta URI
http.method_not_implemented = El Metodo [{0}] no esta implementado por este servlet para esta URI
http.method_get_not_supported = El Metodo HTTP GET no est\u00E1 soportado por esta URL
http.method_post_not_supported = El Metodo HTTP POST no est\u00E1 soportado por esta URL
http.method_put_not_supported = El Metodo HTTP PUT no est\u00E1 soportado por esta URL
......
......@@ -16,11 +16,11 @@
# Default localized string information
# Localized for Locale fr_FR
err.cookie_name_is_token=Le nom de cookie \"{0}\" est un \"token\" r\u00e9serv\u00e9
err.io.negativelength=Taille n\u00e9gative donn\u00e9e dans la m\u00e9thode \"write\"
err.cookie_name_is_token=Le nom de cookie [{0}] est un "token" r\u00e9serv\u00e9
err.io.negativelength=Taille n\u00e9gative donn\u00e9e dans la m\u00e9thode "write"
err.io.short_read=Lecture partielle
http.method_not_implemented=Le m\u00e9thode {0} n''est pas d\u00e9finie dans la RFC 2068 et n''est pas support\u00e9e par l''API Servlet
http.method_not_implemented=Le m\u00e9thode [{0}] n''est pas d\u00e9finie dans la RFC 2068 et n''est pas support\u00e9e par l''API Servlet
http.method_get_not_supported=La m\u00e9thode HTTP GET n''est pas support\u00e9e par cette URL
http.method_post_not_supported=La m\u00e9thode HTTP POST n''est pas support\u00e9e par cette URL
......
......@@ -16,11 +16,11 @@
# Default localized string information
# Localized for Locale ja_JP
err.cookie_name_is_token=\u30af\u30c3\u30ad\u30fc\u540d \"{0}\" \u306f\u4e88\u7d04\u6e08\u306e\u30c8\u30fc\u30af\u30f3\u3067\u3059\u3002
err.cookie_name_is_token=\u30af\u30c3\u30ad\u30fc\u540d [{0}] \u306f\u4e88\u7d04\u6e08\u306e\u30c8\u30fc\u30af\u30f3\u3067\u3059\u3002
err.io.negativelength=write\u30e1\u30bd\u30c3\u30c9\u306b\u8ca0\u306e\u9577\u3055\u304c\u6307\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002
err.io.short_read=\u8aad\u307f\u8fbc\u307f\u304c\u3059\u3050\u306b\u7d42\u308f\u308a\u307e\u3057\u305f\u3002
http.method_not_implemented=\u30e1\u30bd\u30c3\u30c9 {0} \u306fRFC 2068\u306b\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u3089\u305a\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8API\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002
http.method_not_implemented=\u30e1\u30bd\u30c3\u30c9 [{0}] \u306fRFC 2068\u306b\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u3089\u305a\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8API\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002
http.method_get_not_supported=HTTP\u306eGET\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
http.method_post_not_supported=HTTP\u306ePOST\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
......
......@@ -16,6 +16,7 @@
*/
package javax.websocket;
import java.lang.reflect.InvocationTargetException;
import java.util.Iterator;
import java.util.ServiceLoader;
......@@ -50,9 +51,10 @@ public abstract class ContainerProvider {
Class<WebSocketContainer> clazz =
(Class<WebSocketContainer>) Class.forName(
DEFAULT_PROVIDER_CLASS_NAME);
result = clazz.newInstance();
} catch (ClassNotFoundException | InstantiationException |
IllegalAccessException e) {
result = clazz.getConstructor().newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException |
IllegalArgumentException | InvocationTargetException | NoSuchMethodException |
SecurityException e) {
// No options left. Just return null.
}
}
......
......@@ -16,6 +16,7 @@
*/
package javax.websocket.server;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
......@@ -175,9 +176,10 @@ public interface ServerEndpointConfig extends EndpointConfig {
Class<Configurator> clazz =
(Class<Configurator>) Class.forName(
DEFAULT_IMPL_CLASSNAME);
result = clazz.newInstance();
} catch (ClassNotFoundException | InstantiationException |
IllegalAccessException e) {
result = clazz.getConstructor().newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException |
IllegalArgumentException | InvocationTargetException |
NoSuchMethodException | SecurityException e) {
// No options left. Just return null.
}
}
......
......@@ -55,13 +55,14 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
protected String charset = "ISO-8859-1";
public String getCharset() {
return this.charset;
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
/**
* The login password for the <code>Manager</code> application.
*/
......@@ -75,6 +76,7 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
this.password = password;
}
/**
* The URL of the <code>Manager</code> application to be used.
*/
......@@ -88,6 +90,7 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
this.url = url;
}
/**
* The login username for the <code>Manager</code> application.
*/
......
......@@ -29,7 +29,8 @@ import org.apache.tools.ant.types.RedirectorElement;
/**
* Abstract base class to add output redirection support for Catalina Ant tasks.
* These tasks require Ant 1.5 or later. <br>
* These tasks require Ant 1.5 or later.
* <br>
* <strong>WARNING:</strong> due to depends chain, Ant could call a Task more
* than once and this can affect the output redirection when configured. If you
* are collecting the output in a property, it will collect the output of only
......@@ -73,8 +74,8 @@ public abstract class BaseRedirectorHelperTask extends Task {
protected boolean failOnError = true;
/**
* <code>true</code> true when output redirection is requested for this task
* . Default is to log on Ant log.
* <code>true</code> true when output redirection is requested for this task.
* Default is to log on Ant log.
*/
protected boolean redirectOutput = false;
......@@ -163,7 +164,7 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
* Property name whose value should be set to the error of the task..
* Property name whose value should be set to the error of the task.
*
* @param errorProperty property name
*
......@@ -189,7 +190,8 @@ public abstract class BaseRedirectorHelperTask extends Task {
/**
* If true, (error and non-error) output will be redirected as specified
* while being sent to Ant's logging mechanism as if no redirection had
* taken place. Defaults to false. <br>
* taken place. Defaults to false.
* <br>
* Actually handled internally, with Ant 1.6.3 it will be handled by the
* <code>Redirector</code> itself.
*
......
......@@ -47,6 +47,7 @@ public class FindLeaksTask extends AbstractCatalinaTask {
return statusLine;
}
/**
* Execute the requested operation.
*
......@@ -54,9 +55,7 @@ public class FindLeaksTask extends AbstractCatalinaTask {
*/
@Override
public void execute() throws BuildException {
super.execute();
execute("/findleaks?statusLine=" + Boolean.toString(statusLine));
}
}
......@@ -89,7 +89,7 @@ import org.apache.tomcat.util.res.StringManager;
* @author Craig R. McClanahan
*/
public abstract class AuthenticatorBase extends ValveBase
implements Authenticator, RegistrationListener {
implements Authenticator, RegistrationListener {
private static final Log log = LogFactory.getLog(AuthenticatorBase.class);
......@@ -457,7 +457,7 @@ implements Authenticator, RegistrationListener {
// The Servlet may specify security constraints through annotations.
// Ensure that they have been processed before constraints are checked
Wrapper wrapper = request.getMappingData().wrapper;
Wrapper wrapper = request.getWrapper();
if (wrapper != null) {
wrapper.servletSecurityAnnotationScan();
}
......@@ -559,7 +559,7 @@ implements Authenticator, RegistrationListener {
if (jaspicProvider == null && !doAuthenticate(request, response) ||
jaspicProvider != null &&
!authenticateJaspic(request, response, jaspicState, false)) {
!authenticateJaspic(request, response, jaspicState, false)) {
if (log.isDebugEnabled()) {
log.debug(" Failed authenticate() test");
}
......
......@@ -590,8 +590,6 @@ public class FormAuthenticator
}
request.getCoyoteRequest().getParameters().recycle();
request.getCoyoteRequest().getParameters().setQueryStringEncoding(
request.getConnector().getURIEncoding());
ByteChunk body = saved.getBody();
......
......@@ -17,7 +17,7 @@ authenticator.formlogin = Referencia directa al formulario de conexi\u00F3n (p\u
authenticator.loginFail = No pude ingresar
authenticator.manager = Excepci\u00F3n inicializando administradores de confianza
authenticator.noAuthHeader = El cliente no ha enviado autorizaci\u00F3n de cabecera
authenticator.notContext = Error de Configuraci\u00F3n\: Debe de estar unido a un Contexto
authenticator.notContext = Error de Configuraci\u00F3n: Debe de estar unido a un Contexto
authenticator.requestBodyTooBig = El cuerpo del requerimiento era demasiado grande para realizar cach\u00E9 durante el proceso de autenticaci\u00F3n
authenticator.sessionExpired = El tiempo permitido para realizar login ha sido excedido. Si deseas continuar, debes hacer clik dos veces y volver a hacer clik otra vez o cerrar y reabrir tu navegador
authenticator.unauthorized = Imposible autenticar mediante las credenciales suministradas
......
......@@ -16,6 +16,7 @@
*/
package org.apache.catalina.authenticator.jaspic;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -113,10 +114,14 @@ public class SimpleServerAuthConfig implements ServerAuthConfig {
while (moduleClassName != null) {
try {
Class<?> clazz = Class.forName(moduleClassName);
ServerAuthModule module = (ServerAuthModule) clazz.newInstance();
ServerAuthModule module =
(ServerAuthModule) clazz.getConstructor().newInstance();
module.initialize(null, null, handler, mergedProperties);
modules.add(module);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
} catch (ClassNotFoundException | InstantiationException |
IllegalAccessException | IllegalArgumentException |
InvocationTargetException | NoSuchMethodException |
SecurityException e) {
AuthException ae = new AuthException();
ae.initCause(e);
throw ae;
......
......@@ -16,7 +16,10 @@
*/
package org.apache.catalina.connector;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
......@@ -37,6 +40,7 @@ import org.apache.coyote.http11.AbstractHttp11JsseProtocol;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.buf.B2CConverter;
import org.apache.tomcat.util.net.SSLHostConfig;
import org.apache.tomcat.util.net.openssl.OpenSSLImplementation;
import org.apache.tomcat.util.res.StringManager;
......@@ -72,7 +76,7 @@ public class Connector extends LifecycleMBeanBase {
ProtocolHandler p = null;
try {
Class<?> clazz = Class.forName(protocolHandlerClassName);
p = (ProtocolHandler) clazz.newInstance();
p = (ProtocolHandler) clazz.getConstructor().newInstance();
} catch (Exception e) {
log.error(sm.getString(
"coyoteConnector.protocolHandlerInstantiationFailed"), e);
......@@ -80,9 +84,10 @@ public class Connector extends LifecycleMBeanBase {
this.protocolHandler = p;
}
if (!Globals.STRICT_SERVLET_COMPLIANCE) {
URIEncoding = "UTF-8";
URIEncodingLower = URIEncoding.toLowerCase(Locale.ENGLISH);
if (Globals.STRICT_SERVLET_COMPLIANCE) {
uriCharset = StandardCharsets.ISO_8859_1;
} else {
uriCharset = StandardCharsets.UTF_8;
}
}
......@@ -236,11 +241,23 @@ public class Connector extends LifecycleMBeanBase {
/**
* URI encoding.
*
* @deprecated This will be removed in 9.0.x onwards
*/
@Deprecated
protected String URIEncoding = null;
/**
* @deprecated This will be removed in 9.0.x onwards
*/
@Deprecated
protected String URIEncodingLower = null;
private Charset uriCharset = StandardCharsets.UTF_8;
/**
* URI encoding as body.
*/
......@@ -720,33 +737,45 @@ public class Connector extends LifecycleMBeanBase {
/**
* @return the character encoding to be used for the URI using the original
* case.
* @return the name of character encoding to be used for the URI using the
* original case.
*/
public String getURIEncoding() {
return this.URIEncoding;
return uriCharset.name();
}
/**
* @return the character encoding to be used for the URI using lower case.
*
* @deprecated This will be removed in 9.0.x onwards
*/
@Deprecated
public String getURIEncodingLower() {
return this.URIEncodingLower;
return uriCharset.name().toLowerCase(Locale.ENGLISH);
}
/**
*
* @return The Charset to use to convert raw URI bytes (after %nn decoding)
* to characters. This will never be null
*/
public Charset getURICharset() {
return uriCharset;
}
/**
* Set the URI encoding to be used for the URI.
*
* @param URIEncoding The new URI character encoding.
*/
public void setURIEncoding(String URIEncoding) {
this.URIEncoding = URIEncoding;
if (URIEncoding == null) {
URIEncodingLower = null;
} else {
this.URIEncodingLower = URIEncoding.toLowerCase(Locale.ENGLISH);
try {
uriCharset = B2CConverter.getCharset(URIEncoding);
} catch (UnsupportedEncodingException e) {
log.warn(sm.getString("coyoteConnector.invalidEncoding",
URIEncoding, uriCharset.name()), e);
}
setProperty("uRIEncoding", URIEncoding);
}
......
......@@ -17,8 +17,8 @@
package org.apache.catalina.connector;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.EnumSet;
import java.util.concurrent.atomic.AtomicBoolean;
......@@ -318,7 +318,7 @@ public class CoyoteAdapter implements Adapter {
res.setNote(ADAPTER_NOTES, response);
// Set query string encoding
req.getParameters().setQueryStringEncoding(connector.getURIEncoding());
req.getParameters().setQueryStringCharset(connector.getURICharset());
}
if (connector.getXpoweredBy()) {
......@@ -447,8 +447,7 @@ public class CoyoteAdapter implements Adapter {
res.setNote(ADAPTER_NOTES, response);
// Set query string encoding
req.getParameters().setQueryStringEncoding
(connector.getURIEncoding());
req.getParameters().setQueryStringCharset(connector.getURICharset());
}
try {
......@@ -772,7 +771,8 @@ public class CoyoteAdapter implements Adapter {
// Possible redirect
MessageBytes redirectPathMB = request.getMappingData().redirectPath;
if (!redirectPathMB.isNull()) {
String redirectPath = URLEncoder.DEFAULT.encode(redirectPathMB.toString(), "UTF-8");
String redirectPath = URLEncoder.DEFAULT.encode(
redirectPathMB.toString(), StandardCharsets.UTF_8);
String query = request.getQueryString();
if (request.isRequestedSessionIdFromURL()) {
// This is not optimal, but as this is not very common, it
......@@ -892,24 +892,14 @@ public class CoyoteAdapter implements Adapter {
// What encoding to use? Some platforms, eg z/os, use a default
// encoding that doesn't give the expected result so be explicit
String enc = connector.getURIEncodingLower();
if (enc == null) {
enc = "iso-8859-1";
}
Charset charset = null;
try {
charset = B2CConverter.getCharsetLower(enc);
} catch (UnsupportedEncodingException e1) {
log.warn(sm.getString("coyoteAdapter.parsePathParam",
enc));
}
Charset charset = connector.getURICharset();
if (log.isDebugEnabled()) {