Merged branch 'jetty-9.4.x' into 'master'.
This commit is contained in:
commit
14f7b03060
|
@ -24,6 +24,8 @@ import org.eclipse.jetty.client.api.Request;
|
||||||
import org.eclipse.jetty.client.api.Response;
|
import org.eclipse.jetty.client.api.Response;
|
||||||
import org.eclipse.jetty.client.api.Result;
|
import org.eclipse.jetty.client.api.Result;
|
||||||
import org.eclipse.jetty.client.util.BufferingResponseListener;
|
import org.eclipse.jetty.client.util.BufferingResponseListener;
|
||||||
|
import org.eclipse.jetty.http.HttpHeader;
|
||||||
|
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||||
import org.eclipse.jetty.http.HttpStatus;
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,12 +52,11 @@ public class ContinueProtocolHandler implements ProtocolHandler
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(Request request, Response response)
|
public boolean accept(Request request, Response response)
|
||||||
{
|
{
|
||||||
if (response.getStatus() == HttpStatus.CONTINUE_100)
|
boolean is100 = response.getStatus() == HttpStatus.CONTINUE_100;
|
||||||
{
|
boolean expect100 = request.getHeaders().contains(HttpHeader.EXPECT, HttpHeaderValue.CONTINUE.asString());
|
||||||
HttpConversation conversation = ((HttpRequest)request).getConversation();
|
HttpConversation conversation = ((HttpRequest)request).getConversation();
|
||||||
return conversation.getAttribute(ATTRIBUTE) == null;
|
boolean handled100 = conversation.getAttribute(ATTRIBUTE) != null;
|
||||||
}
|
return (is100 || expect100) && !handled100;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue