Skip to content

Commit

Permalink
Issue #2901 - Moving Http Upgrader to Http Conversation
Browse files Browse the repository at this point in the history
+ Solves for Authentication and Redirect

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Sep 12, 2018
1 parent aebe436 commit 00843c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected HttpRequest(HttpClient client, HttpConversation conversation, URI uri)
headers.put(userAgentField);
}

protected HttpConversation getConversation()
public HttpConversation getConversation()
{
return conversation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ public Result exchangeTerminating(HttpExchange exchange, Result result)

// 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);
}
}
}
Expand Down

0 comments on commit 00843c8

Please sign in to comment.