if (headerChars[i] == QUOTE) { String value = String.valueOf(headerChars, valueStart, i - valueStart); response.add(new ETag(weak, value.trim())); searchingFor = SearchingFor.START_OF_VALUE; if (!malformed) { String value = String.valueOf(headerChars, valueStart, i - valueStart); response.add(new ETag(weak, value.trim())); searchingFor = SearchingFor.START_OF_VALUE; response.add(new ETag(weak, value.trim()));
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final CachedHttpRequest that = (CachedHttpRequest) o; if (responseCode != that.responseCode) return false; if (contentEncoding != null ? !contentEncoding.equals(that.contentEncoding) : that.contentEncoding != null) return false; if (contentLocation != null ? !contentLocation.equals(that.contentLocation) : that.contentLocation != null) return false; if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false; if (etag != null ? !etag.equals(that.etag) : that.etag != null) return false; if (language != null ? !language.equals(that.language) : that.language != null) return false; if (lastModified != null ? !lastModified.equals(that.lastModified) : that.lastModified != null) return false; if (path != null ? !path.equals(that.path) : that.path != null) return false; return true; }
rangeResponse = range.getResponseResult(resource.getContentLength(), exchange.getRequestHeaders().getFirst(Headers.IF_RANGE), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart(); exchange.getResponseHeaders().put(Headers.ETAG, etag.toString());
exchange.getResponseHeaders().put(Headers.CONTENT_LANGUAGE, etag.toString());
@Override public int hashCode() { int result = path != null ? path.hashCode() : 0; result = 31 * result + (etag != null ? etag.hashCode() : 0); result = 31 * result + (contentEncoding != null ? contentEncoding.hashCode() : 0); result = 31 * result + (contentLocation != null ? contentLocation.hashCode() : 0); result = 31 * result + (language != null ? language.hashCode() : 0); result = 31 * result + (contentType != null ? contentType.hashCode() : 0); result = 31 * result + (lastModified != null ? lastModified.hashCode() : 0); result = 31 * result + responseCode; return result; } }
resp.setHeader(Headers.ETAG_STRING, etag.toString()); rangeResponse = range.getResponseResult(resource.getContentLength(), req.getHeader(Headers.IF_RANGE_STRING), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart();
static void writeCacheHeaders(final HttpServerExchange exchange, final int status, final OperationParameter operationParameter) { final HeaderMap responseHeaders = exchange.getResponseHeaders(); // No need to send this in a 304 // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 if (operationParameter.getMaxAge() > 0 && status != 304) { responseHeaders.put(Headers.CACHE_CONTROL, "max-age=" + operationParameter.getMaxAge() + ", private, must-revalidate"); } if (operationParameter.getEtag() != null) { responseHeaders.put(Headers.ETAG, operationParameter.getEtag().toString()); } }
@Override public int hashCode() { int result = path != null ? path.hashCode() : 0; result = 31 * result + (etag != null ? etag.hashCode() : 0); result = 31 * result + (contentEncoding != null ? contentEncoding.hashCode() : 0); result = 31 * result + (contentLocation != null ? contentLocation.hashCode() : 0); result = 31 * result + (language != null ? language.hashCode() : 0); result = 31 * result + (contentType != null ? contentType.hashCode() : 0); result = 31 * result + (lastModified != null ? lastModified.hashCode() : 0); result = 31 * result + responseCode; return result; } }
resp.setHeader(Headers.ETAG_STRING, etag.toString()); rangeResponse = range.getResponseResult(resource.getContentLength(), req.getHeader(Headers.IF_RANGE_STRING), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if (rangeResponse != null) { start = rangeResponse.getStart();
if (headerChars[i] == QUOTE) { String value = String.valueOf(headerChars, valueStart, i - valueStart); return new ETag(weak, value.trim()); if (!malformed) { String value = String.valueOf(headerChars, valueStart, i - valueStart); return new ETag(weak, value.trim()); return new ETag(weak, value.trim());
exchange.getResponseHeaders().put(Headers.CONTENT_LANGUAGE, etag.toString());
@Override public int hashCode() { int result = path != null ? path.hashCode() : 0; result = 31 * result + (etag != null ? etag.hashCode() : 0); result = 31 * result + (contentEncoding != null ? contentEncoding.hashCode() : 0); result = 31 * result + (contentLocation != null ? contentLocation.hashCode() : 0); result = 31 * result + (language != null ? language.hashCode() : 0); result = 31 * result + (contentType != null ? contentType.hashCode() : 0); result = 31 * result + (lastModified != null ? lastModified.hashCode() : 0); result = 31 * result + responseCode; return result; } }
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final CachedHttpRequest that = (CachedHttpRequest) o; if (responseCode != that.responseCode) return false; if (contentEncoding != null ? !contentEncoding.equals(that.contentEncoding) : that.contentEncoding != null) return false; if (contentLocation != null ? !contentLocation.equals(that.contentLocation) : that.contentLocation != null) return false; if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false; if (etag != null ? !etag.equals(that.etag) : that.etag != null) return false; if (language != null ? !language.equals(that.language) : that.language != null) return false; if (lastModified != null ? !lastModified.equals(that.lastModified) : that.lastModified != null) return false; if (path != null ? !path.equals(that.path) : that.path != null) return false; return true; }
rangeResponse = range.getResponseResult(resource.getContentLength(), exchange.getRequestHeaders().getFirst(Headers.IF_RANGE), resource.getLastModified(), resource.getETag() == null ? null : resource.getETag().getTag()); if(rangeResponse != null){ start = rangeResponse.getStart(); exchange.getResponseHeaders().put(Headers.ETAG, etag.toString());
if(!ETagUtils.handleIfNoneMatch(exchange, new ETag(false, etag), false)) { exchange.setStatusCode(StatusCodes.NOT_MODIFIED); return true;
exchange.getResponseHeaders().put(Headers.CONTENT_LANGUAGE, etag.toString());
@Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final CachedHttpRequest that = (CachedHttpRequest) o; if (responseCode != that.responseCode) return false; if (contentEncoding != null ? !contentEncoding.equals(that.contentEncoding) : that.contentEncoding != null) return false; if (contentLocation != null ? !contentLocation.equals(that.contentLocation) : that.contentLocation != null) return false; if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false; if (etag != null ? !etag.equals(that.etag) : that.etag != null) return false; if (language != null ? !language.equals(that.language) : that.language != null) return false; if (lastModified != null ? !lastModified.equals(that.lastModified) : that.lastModified != null) return false; if (path != null ? !path.equals(that.path) : that.path != null) return false; return true; }