Skip to content

Latest commit

 

History

History
94 lines (87 loc) · 16.6 KB

changes.md

File metadata and controls

94 lines (87 loc) · 16.6 KB

Changes log

  • 2.7.1 (??-??-2026)

    • Bugs fixed

      • A request whose preconditions fail (If-Match, If-None-Match...) with a method that the resource does not support is now answered 405 (Method Not Allowed) with the Allow header, instead of 412 (Precondition Failed) or of the status of a custom precondition such as 428, as RFC 9110 section 13.2.1 requires. The supported methods are the ones declared by ServerResource.updateAllowedMethods(), the annotated methods by default; a resource that declares nothing is not changed. Issue #1752.
      • A conditional write (If-Match, If-None-Match...) to a resource that supports the method but cannot be read (for example an annotated @Put without GET) was answered 405 (Method Not Allowed) by the missing GET, used to retrieve the validators, although the method is supported. The preconditions are now evaluated as for a resource with no known representation: If-Match fails with 412, If-None-Match passes. The resource can override getInfo() to provide its validators. Only a resource that declares its methods (ServerResource.updateAllowedMethods(), the annotated methods by default) is concerned. Issue #1753.
      • An If-Range header carrying a date is now honoured only if that date is a strong validator, as RFC 9110 section 13.1.5 requires: a Last-Modified less than one second older than the response is weak, so the range is ignored and the whole entity is sent instead of a partial content. Issue #1742.
      • DefaultSslContextFactory now uses the JVM default algorithms for the trust manager (TrustManagerFactory.getDefaultAlgorithm(), PKIX) and the key manager (KeyManagerFactory.getDefaultAlgorithm()) instead of the obsolete SunX509, unless the ssl.TrustManagerFactory.algorithm or ssl.KeyManagerFactory.algorithm system property, the trustManagerAlgorithm or keyManagerAlgorithm parameter, or the setters say otherwise. A valid certificate chain that is not in order is no longer rejected with a "Certificate chaining error". The PKIX validation is the standard one, and stricter than SunX509 on unusual chains: set the trust manager algorithm to SunX509 to get the previous behavior. Issue #1397.
      • Redirector.getTargetRef() now removes the dot segments (. and ..) of the target URI (RFC 3986, section 5.2.4), so the Location header of a client redirection and the URI of a server redirection are normalized. Relative-path targets such as ../x are left untouched, as they need their base reference. A reverse proxy built on http://backend/root/{rr} now resolves a .. found in the remaining part itself, which it did not before the request reached the backend. Issue #238.
      • The Jackson, Gson and JSON (org.json) converters now handle the application/*+json media types, such as application/vnd.example+json. They were ignored, so an incoming +json entity was not converted, and a +json response was left to another converter (such as JAXB) when it scored higher than the 0.5 given by Jackson. A custom converter that won for these media types may now lose to the JSON converters. Issue #1185.
      • A HEAD request answered 304 (Not Modified) now carries the same headers as the GET request: the validators and caching headers only, not the other entity headers such as Content-Type and Last-Modified (RFC 9110, section 15.4.5). Issue #1738.
      • The Range header is now applied to GET requests only, as RFC 9110 section 14.2 requires: a HEAD request with a range was answered "206 Partial Content" (and so was OPTIONS), it is now answered as without the range. Issue #1734.
      • A CacheDirective created by a factory, such as CacheDirective.maxAge(60), now equals the same directive read from a header: equals and hashCode use the name and the value only, no longer the digit attribute, which has no effect on the written header. isDigit(), setDigit(boolean) and the constructor CacheDirective(String, String, boolean) are deprecated and will be removed in Restlet 3.0. Issue #1730.
      • A 304 (Not Modified) response now carries the Expires header of the entity, as RFC 9110 section 15.4.5 requires, so that a revalidating cache refreshes it. Issue #1712.
      • Slf4j bridge reports wrong line number and caller class in log4j. Issue #233.
      • When GET is an allowed method of a server resource, HEAD is now also listed (e.g. in the Allow header of a 405 response). Issue #266.
      • The Max-Age and Path attributes of a version 1 cookie are no longer quoted in the Set-Cookie header, as browsers ignore them otherwise. Issue #1334.
      • CookieAuthenticator no longer lets the next restlet overwrite the redirection sent after a login. Issue #554.
      • CorsService and CorsFilter now add Vary: Origin to every response when the CORS answer depends on the request origin (origin allow-list or credentials allowed), including requests without an Origin header, so shared caches no longer serve the response of one origin to another. A static * without credentials still sends no Vary, as recommended by the Fetch standard. Issue #1611.
      • Fixed the parsing of a WWW-Authenticate challenge made of a token68 ending with = (such as a Negotiate token): the whole header was dropped. Issue #191.
      • The realm and charset parameters of an HTTP Basic challenge are now recognized whatever their case (Realm=, Charset=), as required by RFC 9110. Issue #1455.
      • ChallengeScheme.valueOf() returned HTTP_OAUTH for the names of the Bearer and MAC schemes (HTTP_Bearer, HTTP_MAC) instead of HTTP_OAUTH_BEARER and HTTP_OAUTH_MAC. Issue #1618.
      • The description of Status.CLIENT_ERROR_TOO_MANY_REQUESTS (429) contained backslashes before the quotes of "rate limiting".
      • CacheDirective.noCache(String), noCache(List), privateInfo(String) and privateInfo(List) produced a doubly quoted value (no-cache="\"Set-Cookie\""), and a list was written as one quoted name per element. The directive value now holds the raw field names (Set-Cookie, or Set-Cookie, Authorization for a list, no quotes), and CacheDirectiveWriter writes them as a single quoted-string (no-cache="Set-Cookie, Authorization"), as required by RFC 9111 section 5.2.2.4. Code reading getValue() of these directives no longer sees the quotes. Issue #745.
      • The Range request header is now handled as RFC 9110 section 14 requires. A header with a range unit other than bytes, or an invalid one (bytes=a-b, bytes=5-3, bytes=, a number too large for a long), is ignored and the whole entity is returned, instead of a 500 error (NumberFormatException), a 501 or a meaningless 206: RangeReader.read returns an empty list and never throws. The bytes unit is matched ignoring case. A range selecting nothing of the entity (first position at or after its end, or bytes=-0) is answered with a 416 (Range Not Satisfiable) and a Content-Range: bytes */length header, instead of a 206 or a response the client could not read. A range ending after the end of the entity (bytes=8-12 on 10 bytes), or a suffix longer than it (bytes=-500), is cut at the end of the entity, instead of an invalid Content-Range or a broken response. An empty entity still ignores the header, and several ranges still get a 501.
      • Tag.equals(Object) compared the names only since 2.7.0, while hashCode() includes the weakness, and the flag of Tag.equals(Object, boolean) was inverted compared to its Javadoc and to Restlet 2.6. Both compare the weakness again as documented, so W/"a" no longer equals "a". Code comparing a tag parsed from a header with new Tag("x") must use new Tag("x", false), as new Tag(String) creates a weak tag. Regression of 2.7.0.
      • If-Range accepted weak entity tags since 2.7.0, which RFC 9110 forbids (the partial content of a weak representation can be spliced with another one): it now uses the strong comparison, so a resource returning a weak tag (the default of new Tag(String)) answers a Range request with an If-Range with a complete 200 response. Use new Tag(value, false) for a strong tag. Regression of 2.7.0.
      • If-None-Match compares the entity tags with the weak comparison whatever the method: since 2.7.0, a weak tag and a strong tag with the same name did not match on a PUT, POST or DELETE. Regression of 2.7.0.
      • If-None-Match: * was ignored for a resource having an entity tag: a "create only" PUT overwrote the existing resource instead of getting a 412 (a GET did not get a 304). It is now false for any existing resource, as required by RFC 9110 section 13.1.2. * is also recognized when it is not the first tag of an If-Match or If-None-Match list.
      • If-Range with a date never matched when the modification date of the entity had milliseconds, as FileRepresentation has, so clients could not resume a download. The dates are now compared with a precision of one second.
    • Enhancements

      • Documented that new Tag() and new Tag(String) create a weak entity tag, which is written as W/"value" and never matches an If-Match or If-Range condition: use new Tag(value, false) for a strong tag. The behaviour is unchanged. Issue #1694.
      • Redirector.MODE_CLIENT_PERMANENT_STRICT answers 308 (Permanent Redirect), which makes the client repeat the request with the same method and content, unlike MODE_CLIENT_PERMANENT (301) that lets a user agent turn a POST into a GET. It comes with Response.redirectPermanentStrict(...), ServerResource.redirectPermanentStrict(...) and Router.redirectPermanentStrict(...). The Javadoc of the 301 helpers no longer promises that the method is kept. Issue #1746.
    • Misc

      • Upgraded Jetty library to version 12.1.14. Issue #1515.
      • Upgraded Jackson library to version 2.22.4.
      • Upgraded org.json library to version 20260814.
      • Upgraded the build tools: Maven wrapper to Maven 3.9.16 (wrapper 3.3.4), maven-bundle-plugin to 6.2.0, maven-enforcer-plugin to 3.7.0, maven-surefire-plugin to 3.6.1 and jacoco-maven-plugin to 0.8.16. With bnd 7 (maven-bundle-plugin 6.x), the Import-Package header of the org.restlet bundle no longer lists the java.* packages nor the org.restlet.* packages it exports itself; the Export-Package headers are unchanged.
      • Deprecated the legacy RFC 2109/2965 cookie API (cookie version, comment and related constructors), to be removed in Restlet 3.0 in favor of RFC 6265.
      • Added an optional origin matcher to CORS (CorsService, CorsFilter, setAllowedOriginMatcher(Predicate<String>)) to accept origins that are not listed, for example any sub-domain. The response always contains the exact request origin; it has no effect while the allowed origins contain *. Issue #1611.
      • CorsService and CorsFilter now log a warning when * is allowed as origin together with credentials (any web site could then send credentialed requests), and their Javadoc references the Fetch standard instead of the W3C CORS draft. Issue #1611.
      • Added an opt-in UTF-8 handling of the HTTP Basic credentials (RFC 7617), enabled with the org.restlet.engine.security.basic.utf8 system property (HttpBasicHelper.UTF8_PROPERTY): a Basic challenge then advertises charset="UTF-8", a server decodes the credentials as UTF-8 (falling back to ISO-8859-1 if they are not valid UTF-8), and a client answering such a challenge encodes its credentials in UTF-8. Disabled by default (ISO-8859-1). Issue #1455.
      • Added the ServerResource.hasPreconditions() and getPreconditionStatus(RepresentationInfo) methods to add preconditions to the standard ones: override both, calling super to keep evaluating the conditional headers of the request. A request that only carries a custom precondition no longer skips the evaluation when hasPreconditions() says so. The Javadoc of doConditionalHandle() now explains that the validators of a conditional PUT, POST or DELETE come from getInfo(), which calls get() by default. Issues #65 and #262.
      • Added ServerResource.setIgnoringPreconditionsOnNonSuccess(boolean) and isIgnoringPreconditionsOnNonSuccess(). When enabled, the preconditions of a request (If-Match, If-None-Match, ...) are ignored if the status set by get() or getInfo() while retrieving the validators is neither a success (2xx) nor 412, so that an error or a redirection set by the resource is no longer replaced by a 304 or a 412, as required by RFC 9110 section 13.2.1. Disabled by default (unchanged behavior), enabled in Restlet 3.0. Issue #129.
      • Added conditional writes on the client side: ClientResource gets per-call overloads put, patch and delete taking Conditions; they apply to that call only and are never retried. Conditions.unchangedSince(Response) builds an "If-Match" condition from the strong entity tag that was read, or an "If-Unmodified-Since" condition if the modification date can be deduced to be strong (the response date is at least one second after it, RFC 9110 section 8.8.2.2), and refuses to build an unconditional write otherwise. Conditions.ifAbsent() builds "If-None-Match: *" to create a resource only if it does not exist. A failed condition is reported as a 412 ResourceException. Issue #100.
      • Added Tag.strongMatch(Tag) and Tag.weakMatch(Tag), the strong and weak comparison functions of RFC 9110 section 8.8.3.2. Tag.equals(Object, boolean) is deprecated in favor of them.
      • Added the ServerResource.hasPreconditions() and getPreconditionStatus(RepresentationInfo) methods to add preconditions to the standard ones: override both, calling super to keep evaluating the conditional headers of the request. A request that only carries a custom precondition no longer skips the evaluation when hasPreconditions() says so. The Javadoc of doConditionalHandle() now explains that the validators of a conditional PUT, POST or DELETE come from getInfo(), which calls get() by default. Issues #65 and #262.
      • Added ServerResource.setIgnoringPreconditionsOnNonSuccess(boolean) and isIgnoringPreconditionsOnNonSuccess(). When enabled, the preconditions of a request (If-Match, If-None-Match, ...) are ignored if the status set by get() or getInfo() while retrieving the validators is neither a success (2xx) nor 412, so that an error or a redirection set by the resource is no longer replaced by a 304 or a 412, as required by RFC 9110 section 13.2.1. Disabled by default (unchanged behavior), enabled in Restlet 3.0. Issue #129.
      • Added the constants of the HTTP statuses 308 (Status.REDIRECTION_PERMANENT_STRICT), 421, 422 (CLIENT_ERROR_UNPROCESSABLE_CONTENT), 426, 428, 431, 451 and 511 of RFC 6585, RFC 9110 and RFC 7725, with their reason phrase, description and URI. Status.valueOf() returned a status without any of them. Issue #850.
      • Added the CacheDirective factories mustUnderstand() (RFC 9111), immutable() (RFC 8246), staleWhileRevalidate(int) and staleIfError(int) (RFC 5861), with their HeaderConstants.CACHE_* names. The two numeric ones reject a negative number of seconds.
      • The Javadoc of ServerResource.getPreconditionStatus() shows how to require conditional writes by answering 428 (Status.CLIENT_ERROR_PRECONDITION_REQUIRED) to a write without precondition.
  • 2.7.0 (30-09-2026)

    • Misc
      • Upgraded Freemarker library to version 2.3.35.
      • Upgraded Jackson library to version 2.22.3.
      • Upgraded Jetty library to version 12.0.39.
      • Upgraded Swagger library to version 2.2.55.
      • Upgraded Swagger parser library to version 2.1.48.
  • 2.7 Release Candidate 1 (23-07-2026)

    • Misc
      • Upgraded Gson library to version 2.14.0.
      • Upgraded Jackson library to version 2.21 (LTS).
      • Upgraded Jetty library to version 2.0.36.
      • Upgraded JSON library to version 20260522.
      • Upgraded Slf4j library to version 2.0.18.
      • Upgraded Springframework library to version 7.0.8.
      • Upgraded Swagger library to version 2.2.50.
      • Upgraded Swagger parser library to version 2.1.43.
      • Upgraded Thymeleaf library to version 3.1.5.RELEASE.
  • 2.7 Milestone 3 (10-06-2026)

    • Enhancements
      • New OpenApi extension (OAS 3.1 only). Contributed by Antoine Nicolas.
    • Bugs fixed
      • Reuse an instance of Random class in RandomUtils. Issue #1487.
      • Complete test classes. Issue #1490.
      • Avoid non-short-circuit logic in FileClientHelper. Issue #1495.
      • Drop the implementations of the clone method. Issue #1498.
  • 2.7 Milestone 2 (29-06-2025)

    • Misc
      • Removed deprecated Servlet extension and related classes in Spring extension
      • Removed deprecated methods in Restlet API
      • Removed internal HTTP and FTP connectors
      • Merged the Jetty client and server HTTP connector into Restlet Engine (new default connectors)
  • 2.7 Milestone 1 (21-06-2025)

    • Misc
      • Removed deprecated extension Atom, Guice, GWT, JAXB, OData
      • Removed edition GWT