enable getCookies for HeaderFramework reusing Jetty CookieCutter

pull/97/head
reger 8 years ago
parent 4186ee6fc0
commit 3f32262654

@ -48,6 +48,7 @@ import javax.servlet.http.Part;
import net.yacy.cora.document.id.DigestURL; import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL; import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.util.NumberTools; import net.yacy.cora.util.NumberTools;
import org.eclipse.jetty.server.CookieCutter;
/** /**
* YaCy servlet request header. * YaCy servlet request header.
@ -229,8 +230,15 @@ public class RequestHeader extends HeaderFramework implements HttpServletRequest
public Cookie[] getCookies() { public Cookie[] getCookies() {
if (_request != null) { if (_request != null) {
return _request.getCookies(); return _request.getCookies();
} else {
String cstr = super.get(COOKIE);
if (cstr != null) {
CookieCutter cc = new CookieCutter(); // reuse jetty cookie parser
cc.addCookieField(cstr);
return cc.getCookies();
}
return null;
} }
throw new UnsupportedOperationException("Not supported yet.");
} }
@Override @Override

Loading…
Cancel
Save