diff --git a/changes.md b/changes.md index 8f8603f12d..f54e429da9 100644 --- a/changes.md +++ b/changes.md @@ -31,6 +31,7 @@ Changes log - `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. diff --git a/org.restlet/src/main/java/org/restlet/data/Tag.java b/org.restlet/src/main/java/org/restlet/data/Tag.java index 9ba4d98e22..874188b4fb 100644 --- a/org.restlet/src/main/java/org/restlet/data/Tag.java +++ b/org.restlet/src/main/java/org/restlet/data/Tag.java @@ -71,14 +71,20 @@ public static Tag parse(String httpTag) { /** * Default constructor. The opaque tag is set to null, and the weakness indicator is set to - * true. + * true: the tag is weak, see {@link #Tag(String)}. */ public Tag() { this(null, true); } /** - * Constructor of weak tags. + * Constructor of weak tags.
+ *
+ * Note that RFC 9110 section 8.8.3 defines an entity tag as strong unless it carries the "W/" + * prefix, whereas this constructor creates a weak tag: it is written as {@code + * W/"value"} and never matches an "If-Match" or "If-Range" condition (strong comparison). To + * create a tag that clients can use to update or resume a representation, use {@code new + * Tag(value, false)}. Restlet 3.0 creates a strong tag here. * * @param opaqueTag The tag value. */