Search in sources :

Example 36 with Http2Response

use of com.webpieces.hpack.api.dto.Http2Response in project webpieces by deanhiller.

the class ProxyResponse method sendRedirectAndClearCookie.

public void sendRedirectAndClearCookie(RouterRequest req, String badCookieName) {
    RedirectResponse httpResponse = new RedirectResponse(false, req.isHttps, req.domain, req.port, req.relativePath);
    Http2Response response = createRedirect(httpResponse);
    responseCreator.addDeleteCookie(response, badCookieName);
    log.info("sending REDIRECT(due to bad cookie) response responseSender=" + stream);
    stream.sendResponse(response);
    channelCloser.closeIfNeeded(request, stream);
}
Also used : Http2Response(com.webpieces.hpack.api.dto.Http2Response) RedirectResponse(org.webpieces.router.api.dto.RedirectResponse)

Aggregations

Http2Response (com.webpieces.hpack.api.dto.Http2Response)36 Test (org.junit.Test)17 StreamWriter (com.webpieces.http2engine.api.StreamWriter)13 PassedIn (org.webpieces.httpfrontend2.api.mock2.MockHttp2RequestListener.PassedIn)13 DataFrame (com.webpieces.http2parser.api.dto.DataFrame)12 Http2Header (com.webpieces.http2parser.api.dto.lib.Http2Header)12 Http2Request (com.webpieces.hpack.api.dto.Http2Request)9 Http2Msg (com.webpieces.http2parser.api.dto.lib.Http2Msg)8 Header (org.webpieces.httpparser.api.common.Header)8 ArrayList (java.util.ArrayList)7 DataWrapper (org.webpieces.data.api.DataWrapper)7 HttpResponse (org.webpieces.httpparser.api.dto.HttpResponse)7 HttpPayload (org.webpieces.httpparser.api.dto.HttpPayload)6 HttpRequest (org.webpieces.httpparser.api.dto.HttpRequest)6 HttpData (org.webpieces.httpparser.api.dto.HttpData)5 Http2Headers (com.webpieces.hpack.api.dto.Http2Headers)3 Http2Push (com.webpieces.hpack.api.dto.Http2Push)3 Http2HeaderName (com.webpieces.http2parser.api.dto.lib.Http2HeaderName)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 ResponseStream (org.webpieces.frontend2.api.ResponseStream)3