Fixes #1878 - Handle 100 Continue response without Expect header.
Fixed - again - accept().
This commit is contained in:
parent
6fd3351272
commit
a436b9eb6c
|
@ -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