Added support for ETag conditional GETs.
This commit is contained in:
parent
cf7e65c704
commit
fed6c39ef3
1 changed files with 7 additions and 0 deletions
|
@ -160,6 +160,10 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
if (ifModifiedSince > -1)
|
if (ifModifiedSince > -1)
|
||||||
reqtrans.setIfModifiedSince (ifModifiedSince);
|
reqtrans.setIfModifiedSince (ifModifiedSince);
|
||||||
} catch (IllegalArgumentException ignore) {}
|
} catch (IllegalArgumentException ignore) {}
|
||||||
|
|
||||||
|
String ifNoneMatch = request.getHeader ("If-None-Match");
|
||||||
|
if (ifNoneMatch != null)
|
||||||
|
reqtrans.setETags (ifNoneMatch);
|
||||||
|
|
||||||
String remotehost = request.getRemoteAddr ();
|
String remotehost = request.getRemoteAddr ();
|
||||||
if (remotehost != null)
|
if (remotehost != null)
|
||||||
|
@ -214,6 +218,9 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
res.addCookie(c);
|
res.addCookie(c);
|
||||||
} catch (Exception ign) {}
|
} catch (Exception ign) {}
|
||||||
|
|
||||||
|
if (hopres.getETag() != null) {
|
||||||
|
res.setHeader ("ETag", hopres.getETag());
|
||||||
|
}
|
||||||
if (hopres.getRedirect () != null) {
|
if (hopres.getRedirect () != null) {
|
||||||
sendRedirect(req, res, hopres.getRedirect ());
|
sendRedirect(req, res, hopres.getRedirect ());
|
||||||
} else if (hopres.getNotModified ()) {
|
} else if (hopres.getNotModified ()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue