diff --git a/build/tmpl/text/changes.txt b/build/tmpl/text/changes.txt index 2cbdffd25e..9b926301e1 100644 --- a/build/tmpl/text/changes.txt +++ b/build/tmpl/text/changes.txt @@ -12,6 +12,7 @@ Changes log Reported by Guillaume Blondeau. - Make the internal server connector listening to specific IP address, if provided. Issue #1256. Reported by Juan Manuel de Blas. + - Fixed resolution of variables f* and h*. Issue #1260. - Enhancements - Add literal conversion support for the Boolean, Byte, Int16, Int32, Int64, Decimal, Single and Double Edm types in the OData extension. diff --git a/modules/org.restlet/src/org/restlet/engine/util/CallResolver.java b/modules/org.restlet/src/org/restlet/engine/util/CallResolver.java index 6188993e52..095ac0bf36 100644 --- a/modules/org.restlet/src/org/restlet/engine/util/CallResolver.java +++ b/modules/org.restlet/src/org/restlet/engine/util/CallResolver.java @@ -117,10 +117,6 @@ public Object resolve(String variableName) { return (entity != null && entity.getSize() != -1) ? Long.toString(entity.getSize()) : null; case "et": return (entity != null && entity.getTag() != null) ? entity.getTag().getName() : null; - case "f": - return getReferenceContent(variableName.substring(1), this.request.getReferrerRef()); - case "h": - return getReferenceContent(variableName.substring(1), this.request.getHostRef()); case "m": return (this.request.getMethod() != null) ? this.request.getMethod().getName() : null; case "p": @@ -128,6 +124,10 @@ public Object resolve(String variableName) { default: if (variableName.startsWith("o")) { return getReferenceContent(variableName.substring(1), this.request.getRootRef()); + } else if (variableName.startsWith("f")) { + return getReferenceContent(variableName.substring(1), this.request.getReferrerRef()); + } else if (variableName.startsWith("h")) { + return getReferenceContent(variableName.substring(1), this.request.getHostRef()); } else if (variableName.startsWith("r")) { return getReferenceContent(variableName.substring(1), this.request.getResourceRef()); }