use of org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler in project spring-framework by spring-projects.
the class GlassFishRequestUpgradeStrategy method handleSuccess.
@Override
protected void handleSuccess(HttpServletRequest request, HttpServletResponse response, UpgradeInfo upgradeInfo, TyrusUpgradeResponse upgradeResponse) throws IOException, ServletException {
TyrusHttpUpgradeHandler handler = request.upgrade(TyrusHttpUpgradeHandler.class);
Writer servletWriter = newServletWriter(handler);
handler.preInit(upgradeInfo, servletWriter, request.getUserPrincipal() != null);
response.setStatus(upgradeResponse.getStatus());
upgradeResponse.getHeaders().forEach((key, value) -> response.addHeader(key, Utils.getHeaderFromList(value)));
response.flushBuffer();
}
Aggregations