Skip to content

Commit

Permalink
Fixed resolution of variables f* and h*. Issue #1260. Reported by PSP…
Browse files Browse the repository at this point in the history
…Synedra.
  • Loading branch information
thboileau committed Apr 22, 2017
1 parent 3feddfb commit c9f6dff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions build/tmpl/text/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ 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":
return (this.request.getProtocol() != null) ? this.request.getProtocol().getName() : null;
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());
}
Expand Down

0 comments on commit c9f6dff

Please sign in to comment.