remove getPreCompressedContentFormats from HttpContent
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
9f8621269c
commit
81f67f3fff
|
@ -17,7 +17,6 @@ import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.eclipse.jetty.http.MimeTypes.Type;
|
import org.eclipse.jetty.http.MimeTypes.Type;
|
||||||
import org.eclipse.jetty.util.resource.Resource;
|
import org.eclipse.jetty.util.resource.Resource;
|
||||||
|
@ -64,12 +63,6 @@ public interface HttpContent
|
||||||
|
|
||||||
Map<CompressedContentFormat, ? extends HttpContent> getPrecompressedContents();
|
Map<CompressedContentFormat, ? extends HttpContent> getPrecompressedContents();
|
||||||
|
|
||||||
default Set<CompressedContentFormat> getPreCompressedContentFormats()
|
|
||||||
{
|
|
||||||
Map<CompressedContentFormat, ? extends HttpContent> precompressedContents = getPrecompressedContents();
|
|
||||||
return (precompressedContents == null) ? Set.of() : precompressedContents.keySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteBuffer getBuffer();
|
ByteBuffer getBuffer();
|
||||||
|
|
||||||
void release();
|
void release();
|
||||||
|
|
|
@ -16,7 +16,6 @@ package org.eclipse.jetty.http;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.eclipse.jetty.http.MimeTypes.Type;
|
import org.eclipse.jetty.http.MimeTypes.Type;
|
||||||
import org.eclipse.jetty.util.resource.Resource;
|
import org.eclipse.jetty.util.resource.Resource;
|
||||||
|
@ -144,12 +143,6 @@ public class PrecompressedHttpContent implements HttpContent
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Set<CompressedContentFormat> getPreCompressedContentFormats()
|
|
||||||
{
|
|
||||||
return Set.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ByteBuffer getBuffer()
|
public ByteBuffer getBuffer()
|
||||||
{
|
{
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class ResourceService
|
||||||
if (passConditionalHeaders(request, response, content, callback))
|
if (passConditionalHeaders(request, response, content, callback))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!content.getPreCompressedContentFormats().isEmpty() || content instanceof PrecompressedHttpContent)
|
if (!_precompressedFormats.isEmpty())
|
||||||
response.getHeaders().put(HttpHeader.VARY, HttpHeader.ACCEPT_ENCODING.asString());
|
response.getHeaders().put(HttpHeader.VARY, HttpHeader.ACCEPT_ENCODING.asString());
|
||||||
|
|
||||||
HttpField contentEncoding = content.getContentEncoding();
|
HttpField contentEncoding = content.getContentEncoding();
|
||||||
|
|
Loading…
Reference in New Issue