- buf.append(location);
- }
-
- location = buf.toString();
- HttpURI uri = new HttpURI(location);
- String path = uri.getDecodedPath();
- String canonical = URIUtil.canonicalPath(path);
- if (canonical == null)
- throw new IllegalArgumentException();
- if (!canonical.equals(path))
- {
- buf = _channel.getRequest().getRootURL();
- buf.append(URIUtil.encodePath(canonical));
- String param=uri.getParam();
- if (param!=null)
- {
- buf.append(';');
- buf.append(param);
- }
- String query=uri.getQuery();
- if (query!=null)
- {
- buf.append('?');
- buf.append(query);
- }
- String fragment=uri.getFragment();
- if (fragment!=null)
- {
- buf.append('#');
- buf.append(fragment);
- }
- location = buf.toString();