Permalink
Browse files

implement RequestHeader getRequestURI, getRequestURL for legacy request

  • Loading branch information...
reger24 committed Mar 12, 2017
1 parent 209a737 commit b4fa1141b82a5e4220cc31ea78457dbb4cbeaa33
Showing with 6 additions and 2 deletions.
  1. +6 −2 source/net/yacy/cora/protocol/RequestHeader.java
@@ -49,6 +49,7 @@
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.util.NumberTools;
import org.eclipse.jetty.server.CookieCutter;
import org.eclipse.jetty.util.URIUtil;
/**
* YaCy servlet request header.
@@ -378,7 +379,7 @@ public String getRequestURI() {
if (_request != null) {
return _request.getRequestURI();
} else {
throw new UnsupportedOperationException("Not supported yet.");
return super.get(HeaderFramework.CONNECTION_PROP_PATH, "/"); // TODO: property as header discouraged (but currently used)
}
}
@@ -387,7 +388,10 @@ public StringBuffer getRequestURL() {
if (_request != null) {
return _request.getRequestURL();
} else {
throw new UnsupportedOperationException("Not supported yet.");
StringBuffer sbuf = new StringBuffer(32);
URIUtil.appendSchemeHostPort(sbuf, this.getScheme(), this.getServerName(), this.getServerPort());
sbuf.append(this.getRequestURI());
return sbuf;
}
}

0 comments on commit b4fa114

Please sign in to comment.