Issue #2901 - Moving Http Upgrader to Http Conversation

+ Solves for Authentication and Redirect

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2018-09-12 14:35:01 -05:00
parent aebe436e00
commit 00843c8ed9
2 changed files with 5 additions and 5 deletions

View File

@ -108,7 +108,7 @@ public class HttpRequest implements Request
headers.put(userAgentField);
}
protected HttpConversation getConversation()
public HttpConversation getConversation()
{
return conversation;
}

View File

@ -110,16 +110,16 @@ public class HttpChannelOverHTTP extends HttpChannel
// Upgrade Response
HttpRequest request = exchange.getRequest();
if (request instanceof HttpConnectionUpgrader)
HttpConnectionUpgrader upgrader = (HttpConnectionUpgrader) request.getConversation().getAttribute(HttpConnectionUpgrader.class.getName());
if (upgrader != null)
{
HttpConnectionUpgrader listener = (HttpConnectionUpgrader)request;
try
{
listener.upgrade(response,getHttpConnection());
upgrader.upgrade(response, getHttpConnection());
}
catch (Throwable x)
{
return new Result(result,x);
return new Result(result, x);
}
}
}