## Changelog

### Tomcat 11.0.0-M5 (markt)

#### Catalina

- Add a `doPatch` method to `HttpServlet` to provide support for the HTTP `PATCH` method as defined in RFC 5789. This is one of the changes in the Servlet 6.1 API. (markt)
- 65995: Implement RFC 9239 and use `text/javascript` as the media type for JavaScript rather than `application/javascript`. (markt)
- Tomcat no longer sets the `java.protocol.handler.pkgs` system property when starting. Users are now free to configure this property if they wish. (markt)
- Add an access log valve that uses a json format. Based on pull request #539 provided by Thomas Meyer. (remm)
- Harden the FORM authentication process against DoS attacks by using a reduced session timeout if the FORM authentication process creates a session. The duration of this timeout is configured by the `authenticationSessionTimeout` attribute of the FORM authenticator. (markt)
- Implement the new Servlet API methods that provide additional control when sending a redirect to the client. (markt)
- Update Digest authentication support to align with RFC 7616. This adds a new configuration attribute, `algorithms`, to the `DigestAuthenticator` with a default of `SHA-256,MD5`. (markt)
- Reduce the default value of `maxParameterCount` from 10,000 to 1,000. (markt)
- 66527: Correct the Javadoc for the `Tomcat.addWebapp()` methods that incorrectly stated that the `docBase` parameter could be a relative path. (markt)
- 66524 Correct eviction ordering in WebResource cache to by LRU as intended. (schultz)
- Add support code for custom user attributes in `RealmBase`. Based on code from #473 by Carsten Klein. (remm)
- Expand the set of HTTP request headers considered sensitive that should be skipped when generating a response to a `TRACE` request. This aligns with the current draft of the Servlet 6.1 specification. (markt)
- 66541: Improve handling for cached resources for resources that use custom URL schemes. The scheme specific `equals()` and `hashcode()` algorithms, if present, will now be used for URLs for these resources. This addresses a potential performance issue with some OSGi custom URL schemes that can trigger potentially slow DNS lookups in some configurations. Based on a patch provided by Tom Whitmore. (markt)
- When using a custom session manager deployed as part of the web application, avoid `ClassNotFoundException`s when validating session IDs extracted from requests. (markt)
- 66543: Give `StandardContext#fireRequestDestroyEvent` its own log message. (fschumacher)
- 66554: Initialize Random during server initialization to avoid possible JVM thread creation in the webapp context on some platforms. (remm)
- Make the server utility executor available to webapps using a Servlet context attribute named `org.apache.tomcat.util.threads.ScheduledThreadPoolExecutor`. (remm)

#### Coyote

- JSON filter should support specific escaping for common special characters as defined in RFC 8259. Based on code submitted by Thomas Meyer. (remm)
- 66511: Fix `GzipOutputFilter` (used for compressed HTTP responses) when used with direct buffers. Patch suggested by Arjen Poutsma. (markt)
- 66512: Align AJP handling of invalid HTTP response headers (they are now removed from the response) with HTTP. (markt)
- 66530: Correct a regression in the fix for bug 66442 that meant that streams without a response body did not decrement the active stream count when completing leading to `ERR_HTTP2_SERVER_REFUSED_STREAM` for some connections. (markt)
- Remove use of deprecated classes in the `javax.security.cert` package. Pull request #608 provided by Eirik Bjorsnos. (markt)

#### Jasper

- Fix bug that meant some instances of coercing a `LambdaExpression` to a functional interface invocation failed. (markt)
- 66536: Fix parsing of tag files that meant that tag directives could be ignored for some tag files. (markt)
- Align the EL implementation with the latest changes to the Jakarta EL specification and add support for the length attribute to the `ArrayElResolver`. (markt)

#### Cluster

- 66535: Redefine the `maxValidTime` attribute of `FarmWarDeployer` to be the maximum time allowed between receiving parts of a transferred file before the transfer is cancelled and the associated resources cleaned-up. A new warning message will be logged if the file transfer is cancelled. (markt)

#### WebSocket

- 66508: When using WebSocket with NIO2, avoid waiting for a timeout before sending the close frame if an I/O error occurs during a write. (markt)
- 66548: Expand the validation of the value of the `Sec-Websocket-Key` header in the HTTP upgrade request that initiates a WebSocket connection. The value is not decoded but it is checked for the correct length and that only valid characters from the base64 alphabet are used. (markt)

#### Web applications

- 66542: Documentation. Update the JNDI documentation to replace references to JavaMail with references to Jakarta Mail. (markt)

#### Other

- Improvements to French translations. (remm)
- Improvements to Japanese translations. Contributed by Shirayuking and tak7iji. (markt)
- Improvements to Chinese translations. Contributed by totoo. (markt)
- Refactor code using `MD5Encoder` to use `HexUtils.toHexString()`. (markt)
- 66507: Fix a bug that `$JAVA_OPTS` is not passed to the jvm in `catalina.sh` when calling `version`. Patch suggested by Eric Hamilton. (lihan)
- Update the internal fork of Commons DBCP to f131286 (2023-03-08, 2.10.0-SNAPSHOT). This corrects a regression introduced in 11.0.0-M2. (markt)
- Improve the error messages if `JRE_HOME` or `JAVA_HOME` are not set correctly. On windows, align the handling of `JRE_HOME` and `JAVA_HOME` for the start-up scripts and the service install script. (markt)
- Update to the Eclipse JDT compiler 4.27. (markt)
- Update UnboundID to 6.0.8. (markt)
- Update Checkstyle to 10.9.3. (markt)
- Update Jacoco to 0.8.9. (markt)

### 2023-03-06 Tomcat 11.0.0-M4 (markt)

#### General

- Fix a bug that memory allocation is larger than limit in `SynchronizedStack` to reduce memory footprint. (lihan)

#### Catalina

- Add support for `txt:` and `rnd:` rewrite map types from mod_rewrite. Based on a pull request #591 provided by Dimitrios Soumis. (remm)
- Provide a more appropriate response (501 rather than 400) when rejecting an HTTP request using the CONNECT method. (markt)
- 66491: Revert the switch to using the ServiceLoader mechanism to load the custom URL protocol handlers that Tomcat uses. The original system property based approach has been restored. (markt)

#### Coyote

- Add a check for the validity of the scheme pseudo-header in HTTP/2. (markt)
- 66482: Restore inline state after async operation in NIO2, to account the fact that unexpected exceptions are sometimes thrown by the implementation. Patch submitted by zhougang. (remm)

#### Jasper

- Provide an implementation of the sub-set of JavaBeans support that does not depend on the `java.beans` package. This for use by Expression Language when the `java.desktop` module (which is where the `java.beans` package resides) is not available. (markt)

### 2023-02-23 Tomcat 11.0.0-M3 (markt)

#### General

- Increase the minimum supported Java version to Java 17. Note that Jakarta EE 11 permits a minimum Java version of 21. The minimum Java version for Tomcat 11 may be increased to Java 21 before the first stable release. (markt)

#### Catalina

- Allow a Valve to access cookies from a request that cannot be mapped to a Context. (markt)
- Implement the new Servlet API methods for setting character encodings that accept `Charset` objects. (markt)
- The default HEAD response no longer includes some HTTP header fields where the value is determined only while generating the content as per section 9.3.2 of RFC 9110. (markt)
- 66438: Correct names of Jakarta modules in JPMS metadata. (markt)
- Switch to using the ServiceLoader mechanism to load the custom URL protocol handlers that Tomcat uses. (markt)
- Switch to using `LongAdder` rather than `AtomicInteger` to track request count and error count for servlets. (markt)
- Implement the clarification from the Jakarta Servlet project that Servlets mapped to the context root should be mapped for requests to the context root with or without the trailing `/`. (markt)
- Implement the clarification from the Jakarta Servlet project that calling `ServletOutputStream.close()` on a stream in non-blocking mode returns immediately with the stream effectively closed and any data remaining to be written is written in the background by the container. (markt)
- Avoid possible ISE when scanning from bad JAR URLs, to restore the previous behavior following the removal of Java 9+ reflection code which caught the ISE. (remm)
- Refactor uses of `String.replaceAll()` to use `String.replace()` where regular expressions where not being used. Pull request #581 provided by Andrei Briukhov. (markt)
- Add error report valve that allows redirecting to of proxying from an external web server. Based on code and ideas from pull request #506 provided by Max Fortun. (remm)
- 66470: Add the Shared Address Space defined by RFC 6598 (100.64.0.0/10) to the regular expression used to identify internal proxies for the `RemoteIpFilter` and `RemoteIpValve`. (markt)
- 66471: Fix JSessionId secure attribute missing When `RemoteIpFilter` determines that this request was submitted via a secure channel. (lihan)
- Add the additional HTTP status code constants to `HttpServletResponse` defined by the Jakarta Servlet project for the Servlet 6.1 API. (markt)
- Implement the clarification from the Jakarta Servlet project that calling one of the `HttpServletResponse` methods for setting HTTP header values with `null` as the new header value removes any existing header of that name. (markt)

#### Coyote

- Log basic information for each configured TLS certificate when Tomcat starts. (markt)
- 66442: When an HTTP/2 response must not include a body, ensure that the end of stream flag is set on the headers frame and that no data frame is sent. (markt)
- Fix a bug that prevented HTTP/2 connections from timing out when using a Connector configured with `useAsyncIO=true` (the default). (markt)
- Provided dedicated loggers (`org.apache.tomcat.util.net.NioEndpoint.certificate` / `org.apache.tomcat.util.net.Nio2Endpoint.certificate`) for logging of configured TLS certificates. (markt)

#### Jasper

- 66419: Fix calls from expression language to a method that accepts varargs when only one argument was passed. (markt)
- 66441: Make imports of static fields in JSPs visible to any EL expressions used on the page. (markt)

#### Web applications

- 66429: Documentation. Limit access to the documentation web application to localhost by default. (markt)
- 66429: Examples. Limit access to the examples web application to localhost by default. (markt)

#### Other

- Update BND to 6.4.0. (markt)
- Remove support for starting Tomcat under a SecurityManager. (markt)
- Improvements to Chinese translations. (lihan)
- Improvements to French translations. (remm)
- Improvements to Japanese translations. Contributed by tak7iji. (markt)
- Improvements to Korean translations. (woonsan)
- Update the packaged version of the Apache Tomcat Native Library to 2.0.3 to pick up the Windows binaries built with with OpenSSL 3.0.8. (markt)

### not released Tomcat 11.0.0-M2 (markt)

#### Catalina

- Update the `ServletInputStream` and `ServletOuputStream` classes in the Servlet API to align with the recent updates in the Jakarta Servlet specification to support reading and writing with `ByteBuffer`s. The changes also clarified various aspects of the Servlet non-blocking API. (markt)
- 66388: Correct a regression in the refactoring that replaced the use of the `URL` constructors. The regression broke lookups for resources that contained one or more characters in their name that required escaping when used in a URI path. (markt)
- 66392: Change the default value of `AccessLogValve`'s file encoding to UTF-8 and update documentation. (lihan)
- 66393: Align `ExtendedAccessLogValve`'s x-P(XXX) with the documentation. (lihan)
- Remove JAX-RPC support which was removed from the Jakarta EE platform for Jakarta EE 9. (markt)

#### Coyote

- Update Cookie parsing and handling to treat the quotes in a quoted cookie value as part of the value as required by RFC 6265 and explicitly clarified in RFC 6265bis. (markt)
- Add an RFC 8941 structured field parser. (markt)
- Add a parser for the `priority` HTTP header field defined in RFC 9218. (markt)
- When resetting an HTTP/2 stream because the final response has been generated before the request has been fully read, use the HTTP/2 error code `NO_ERROR` so that client does not discard the response. Based on a suggestion by Lorenzo Dalla Vecchia. (markt)
- 66385: Correct a bug in HTTP/2 where a non-blocking read for a new frame with the NIO2 connector was incorrectly made using the read timeout leading to unexpected stream closure. (markt)

#### Jasper

- 66370: Change the default of the `org.apache.el.GET_CLASSLOADER_USE_PRIVILEGED` system property to `true` unless the EL library is running on Tomcat in which case the default remains `false` as the EL library is already called from within a privileged block and skipping the unnecessary privileged block improves performance. (markt)
- Add support for specifying Java 21 (with the value `21`) as the compiler source and/or compiler target for JSP compilation. If used with an Eclipse JDT compiler version that does not support these values, a warning will be logged and the default will used. (markt)

#### Other

- Update the packaged version of the Apache Tomcat Migration Tool for Jakarta EE to 1.0.6. (markt)
- Update the internal fork of Apache Commons BCEL to 2ee2bff (2023-01-03, 6.7.1-SNAPSHOT). (markt)
- Update the internal fork of Apache Commons Codec to 3eafd6c (2023-01-03, 1.16-SNAPSHOT). (markt)
- Update the internal fork of Apache Commons FileUpload to 34eb241 (2023-01-03, 2.0-SNAPSHOT). (markt)
- Update the internal fork of Apache Commons DBCP to f131286 (2023-01-03, 2.10.0-SNAPSHOT). (markt)
- Improvements to Japanese translations. Contributed by Shirayuking. (markt)
- Improvements to Portuguese translations. Contributed by Guilherme Custódio. (markt)
- Update to the Eclipse JDT compiler 4.26. (markt)
- Update Checkstyle to 10.6.0. (markt)
- Update Unboundid to 6.0.7. (markt)
- Update SpotBugs to 4.7.3. (markt)

### 2022-12-05 Tomcat 11.0.0-M1 (markt)

#### General

- This release contains all of the changes up to and including those in Apache Tomcat 10.1.1 plus the additional changes listed below. (markt)

#### Catalina

- 66175: Change the default character set used by the `BasicAuthenticator` from ISO-8859-1 to UTF-8. (markt)
- 66209: Add a configuration option to allow bloom filters used to index JAR files to be retained for the lifetime of the web application. Prior to this addition, the indexes were always flushed by the periodic calls to `WebResourceRoot.gc()`. As part of this addition, configuration of archive indexing moves from `Context` to `WebResourceRoot`. Based on a patch provided by Rahul Jaisimha. (markt)
- 66330: Correct a regression introduced when fixing 62897 that meant any value configured for `skipMemoryLeakChecksOnJvmShutdown` on the `Context` was ignored and the default was always used. (markt)
- 66331: Fix a regression in refactoring for `Stack` on the `SystemLogHandler` which caught incorrect exception. (lihan)
- 66338: Fix a regression that caused a nuance in refactoring for `ErrorReportValve`. (lihan)
- Escape values used to construct output for the `JsonErrorReportValve` to ensure that it always outputs valid JSON. (markt)
- Correct the default implementation of `HttpServletRequest.isTrailerFieldsReady()` to return `true` so it is consistent with the default implementation of `HttpServletRequest.getTrailerFields()` and with the Servlet API provided by the Jakarta EE project. (markt)
- Refactor `WebappLoader` so it only has a runtime dependency on the migration tool for Jakarta EE if configured to use the converter as classes are loaded. (markt)
- Improve the behavior of the credential handler attribute that is set in the Servlet context so that it actually reflects what is used during authentication. (remm)
- 66359: Update javadoc for RemoteIpValve and RemoteIpFilter with correct `protocolHeader` default value of "X-Forwarded-Proto". (lihan)
- Add support for the new attribute for error dispatches `jakarta.servlet.error.query_string`. (markt)
- Update `ignoreAnnotation` attribute on `Context` to dissociate it from `metadata-complete`. (remm)

#### Coyote

- Correct the date format used with the expires attribute of HTTP cookies. A single space rather than a single dash should be used to separate the day, month and year components to be compliant with RFC 6265. (markt)
- Include the name of the current stream state in the error message when a stream is cancelled due to an attempt to write to the stream when it is in a state that does not permit writes. (markt)
- NIO writes never return -1 so refactor `CLOSED_NIO_CHANNEL` not to do so and remove checks for this return value. Based on #562 by tianshuang. (markt)
- Remove unnecessary code that exposed the `asyncTimeout` to components that never used it. (markt)
- Ensure that all `MessageBytes` conversions to byte arrays are valid for the configured character set and throw an exception if not. (markt)
- When an HTTP/2 stream was reset, the current active stream count was not reduced. If enough resets occurred on a connection, the current active stream count limit was reached and no new streams could be created on that connection. (markt)

#### Jasper

- 66294: Make the use of a privileged block to obtain the thread context class loader added to address 62080 optional and disabled by default. This is now controlled by the `org.apache.el.GET_CLASSLOADER_USE_PRIVILEGED` system property. (markt)
- 66317: Fix for Lambda coercion security manager missing privileges. Based on pull request #557 by Isaac Rivera Rivas (lihan)
- 66325: Fix concurrency issue in evaluation of expression language containing lambda expressions. (markt)
- Update the `ErrorData` class in the JSP API to align with the recent changes in the Jakarta Pages specification to support the new error dispatch attribute `jakarta.servlet.error.query_string`.

#### Web applications

- 66348: Update the JARs listed in the class loader documentation and note which ones are optional. (markt)
- Documentation. Replace references in the application developer's guide to CVS with more general references to a source code control system. (markt)

#### jdbc-pool

- 66346: Ensure all JDBC pool JARs are reproducible. Pull request #566 provided by John Neffenger. (markt)

#### Other

- Update to Commons Daemon 1.3.3. (markt)
- 66323: Move module start up parameters from `JDK_JAVA_OPTIONS` to `JAVA_OPTS` now that the minimum Java version is 11 and these options are always required. (markt)
- Improvements to Chinese translations. Contributed by DigitalCat and lihan. (markt)
- Improvements to French translations. Contributed by Mathieu Bouchard. (markt)
- Improvements to Japanese translations. Contributed by Shirayuking and tak7iji. (markt)
- Improvements to Korean translations. (markt)
- Improvements to Spanish translations. (markt)
- Correct a regression in the removal of the APR connector that broke Graal native image support. Pull request #564 provided by Sébastien Deleuze. (markt)
- Update the packaged version of the Apache Tomcat Native Library to 2.0.2 to pick up the Windows binaries built with with OpenSSL 3.0.7. (markt)
- Update the packaged version of the Apache Tomcat Migration Tool for Jakarta EE to 1.0.5. (markt)
- Refactor code base to replace use of URL constructors. While they are deprecated in Java 20 onwards, the reasons for deprecation are valid for all versions so move away from them now. (markt)
- Refine the Tomcat native image metadata to avoid including unintended non-Tomcat resources. Pull request #569 provided by Sébastien Deleuze. (markt)
- Update the internal fork of Apache Commons BCEL to b015e90 (2022-11-28, 6.7.0-RC1). (markt)
- Update the internal fork of Apache Commons Codec to ae32a3f (2022-11-29, 1.16-SNAPSHOT). (markt)
- Update the internal fork of Apache Commons FileUpload to aa8eff6 (2022-11-29, 2.0-SNAPSHOT). (markt)