String absolute = toAbsolute(url);
if (isEncodeable(absolute)) {
// W3c spec clearly said
- if (url.equalsIgnoreCase("")){
+ if (url.equalsIgnoreCase("")) {
url = absolute;
+ } else if (url.equals(absolute) && !hasPath(url)) {
+ url += '/';
}
return (toEncoded(url, request.getSessionInternal().getIdInternal()));
} else {
/**
+ * Determine if an absolute URL has a path component
+ */
+ private boolean hasPath(String uri) {
+ int pos = uri.indexOf("://");
+ if (pos < 0) {
+ return false;
+ }
+ pos = uri.indexOf('/', pos + 3);
+ if (pos < 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
* Determine if a URI string has a <code>scheme</code> component.
*/
private boolean hasScheme(String uri) {
<bug>51473</bug>: Fix concatenation of values in
<code>SecurityConfig.setSecurityProperty()</code>. (kkolinko)
</fix>
+ <fix>
+ Fix response.encodeURL() for the special case of an absolute URL
+ with no path segment (http://name). (rjung)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">