realm = originalFuture.getRealm(); } else { realm = request.getRealm(); if (realm == null) { realm = config.getRealm();
this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirect = prototype.getFollowRedirect();
.setNameResolver(request.getNameResolver()) .setProxyServer(request.getProxyServer()) .setRealm(request.getRealm()) .setRequestTimeout(request.getRequestTimeout());
public void operationComplete(ChannelFuture cf) { if (!abortOnThrowable(cf.getCause(), cf.getChannel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization process before publishing events as we will re-publish again the same event after the authorization, * causing unpredictable behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { if (notifyHeaders) { ProgressAsyncHandler.class.cast(asyncHandler).onHeadersWritten(); } else { ProgressAsyncHandler.class.cast(asyncHandler).onContentWritten(); } } } }
public void operationComplete(ChannelFuture cf) { if (!abortOnThrowable(cf.getCause(), cf.getChannel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization process before publishing events as we will re-publish again the same event after the authorization, * causing unpredictable behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { if (notifyHeaders) { ProgressAsyncHandler.class.cast(asyncHandler).onHeaderWriteCompleted(); } else { ProgressAsyncHandler.class.cast(asyncHandler).onContentWriteCompleted(); } } } }
@Override public void operationComplete(ChannelProgressiveFuture cf) { // The write operation failed. If the channel was cached, it means it got asynchronously closed. // Let's retry a second time. if (!abortOnThrowable(cf.cause(), cf.channel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization * process before publishing events as we will re-publish again the * same event after the authorization, causing unpredictable * behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { ProgressAsyncHandler<?> progressAsyncHandler = (ProgressAsyncHandler<?>) asyncHandler; if (notifyHeaders) { progressAsyncHandler.onHeadersWritten(); } else { progressAsyncHandler.onContentWritten(); } } } }
@Override public void operationComplete(ChannelProgressiveFuture cf) { // The write operation failed. If the channel was cached, it means it got asynchronously closed. // Let's retry a second time. if (!abortOnThrowable(cf.cause(), cf.channel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization * process before publishing events as we will re-publish again the * same event after the authorization, causing unpredictable * behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { ProgressAsyncHandler<?> progressAsyncHandler = (ProgressAsyncHandler<?>) asyncHandler; if (notifyHeaders) { progressAsyncHandler.onHeaderWriteCompleted(); } else { progressAsyncHandler.onContentWriteCompleted(); } } } }
Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); boolean connect = future.getNettyRequest().getHttpRequest().getMethod() == HttpMethod.CONNECT; requestFactory.addAuthorizationHeader(headers, requestFactory.firstRequestOnlyAuthorizationHeader(request, uri, proxy, realm));
private boolean handleHttpResponse(final HttpResponse response, final Channel channel, final NettyResponseFuture<?> future, AsyncHandler<?> handler) throws Exception { HttpRequest httpRequest = future.getNettyRequest().getHttpRequest(); ProxyServer proxyServer = future.getProxyServer(); logger.debug("\n\nRequest {}\n\nResponse {}\n", httpRequest, response); // store the original headers so we can re-send all them to // the handler in case of trailing headers future.setHttpHeaders(response.headers()); future.setKeepAlive(connectionStrategy.keepAlive(httpRequest, response)); NettyResponseStatus status = new NettyResponseStatus(future.getUri(), config, response, channel); int statusCode = response.getStatus().code(); Request request = future.getRequest(); Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); NettyResponseHeaders responseHeaders = new NettyResponseHeaders(response.headers()); return exitAfterProcessingFilters(channel, future, handler, status, responseHeaders) || exitAfterHandling401(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling407(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling100(channel, future, statusCode) || // exitAfterHandlingRedirect(channel, future, response, request, statusCode, realm) || // exitAfterHandlingConnect(channel, future, request, proxyServer, statusCode, httpRequest) || // exitAfterHandlingStatus(channel, future, response, handler, status) || // exitAfterHandlingHeaders(channel, future, response, handler, responseHeaders); }
private boolean handleHttpResponse(final HttpResponse response, final Channel channel, final NettyResponseFuture<?> future, AsyncHandler<?> handler) throws Exception { HttpRequest httpRequest = future.getNettyRequest().getHttpRequest(); ProxyServer proxyServer = future.getProxyServer(); logger.debug("\n\nRequest {}\n\nResponse {}\n", httpRequest, response); // store the original headers so we can re-send all them to // the handler in case of trailing headers future.setHttpHeaders(response.headers()); future.setKeepAlive(connectionStrategy.keepAlive(httpRequest, response)); NettyResponseStatus status = new NettyResponseStatus(future.getUri(), config, response, channel); int statusCode = response.getStatus().code(); Request request = future.getRequest(); Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); NettyResponseHeaders responseHeaders = new NettyResponseHeaders(response.headers()); return exitAfterProcessingFilters(channel, future, handler, status, responseHeaders) || exitAfterHandling401(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling407(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling100(channel, future, statusCode) || // exitAfterHandlingRedirect(channel, future, response, request, statusCode, realm) || // exitAfterHandlingConnect(channel, future, request, proxyServer, statusCode, httpRequest) || // exitAfterHandlingStatus(channel, future, response, handler, status) || // exitAfterHandlingHeaders(channel, future, response, handler, responseHeaders) || exitAfterHandlingReactiveStreams(channel, future, response, handler); }
Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); boolean connect = future.getNettyRequest().getHttpRequest().getMethod() == HttpMethod.CONNECT; requestFactory.addAuthorizationHeader(headers, requestFactory.firstRequestOnlyAuthorizationHeader(request, uri, proxy, realm));
private boolean handleHttpResponse(final HttpResponse response,// final Channel channel,// final NettyResponseFuture<?> future,// AsyncHandler<?> handler) throws Exception { HttpRequest httpRequest = future.getNettyRequest().getHttpRequest(); ProxyServer proxyServer = future.getProxyServer(); logger.debug("\n\nRequest {}\n\nResponse {}\n", httpRequest, response); // store the original headers so we can re-send all them to // the handler in case of trailing headers future.setHttpHeaders(response.headers()); future.setKeepAlive(connectionStrategy.keepAlive(httpRequest, response)); NettyResponseStatus status = new NettyResponseStatus(future.getUri(), config, response, channel); int statusCode = response.getStatus().getCode(); Request request = future.getRequest(); Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); NettyResponseHeaders responseHeaders = new NettyResponseHeaders(response.headers()); return exitAfterProcessingFilters(channel, future, handler, status, responseHeaders) || exitAfterHandling401(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling407(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling100(channel, future, statusCode) || // exitAfterHandlingRedirect(channel, future, response, request, statusCode, realm) || // exitAfterHandlingConnect(channel, future, request, proxyServer, statusCode, httpRequest) || // exitAfterHandlingStatus(channel, future, response, handler, status) || // exitAfterHandlingHeaders(channel, future, response, handler, responseHeaders) || // exitAfterHandlingBody(channel, future, response, handler); }
private boolean handleHttpResponse(final HttpResponse response,// final Channel channel,// final NettyResponseFuture<?> future,// AsyncHandler<?> handler) throws Exception { HttpRequest httpRequest = future.getNettyRequest().getHttpRequest(); ProxyServer proxyServer = future.getProxyServer(); logger.debug("\n\nRequest {}\n\nResponse {}\n", httpRequest, response); // store the original headers so we can re-send all them to // the handler in case of trailing headers future.setHttpHeaders(response.headers()); future.setKeepAlive(connectionStrategy.keepAlive(httpRequest, response)); NettyResponseStatus status = new NettyResponseStatus(future.getUri(), config, response, channel); int statusCode = response.getStatus().getCode(); Request request = future.getRequest(); Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm(); NettyResponseHeaders responseHeaders = new NettyResponseHeaders(response.headers()); return exitAfterProcessingFilters(channel, future, handler, status, responseHeaders) || exitAfterHandling401(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling407(channel, future, response, request, statusCode, realm, proxyServer) || // exitAfterHandling100(channel, future, statusCode) || // exitAfterHandlingRedirect(channel, future, response, request, statusCode, realm) || // exitAfterHandlingConnect(channel, future, request, proxyServer, statusCode, httpRequest) || // exitAfterHandlingStatus(channel, future, response, handler, status) || // exitAfterHandlingHeaders(channel, future, response, handler, responseHeaders) || // exitAfterHandlingBody(channel, future, response, handler); }
public RequestImpl(Request prototype) { if (prototype != null) { this.method = prototype.getMethod(); this.uri = prototype.getUri(); this.address = prototype.getInetAddress(); this.localAddress = prototype.getLocalAddress(); this.headers = new FluentCaseInsensitiveStringsMap(prototype.getHeaders()); this.cookies = new ArrayList<>(prototype.getCookies()); this.byteData = prototype.getByteData(); this.compositeByteData = prototype.getCompositeByteData(); this.stringData = prototype.getStringData(); this.byteBufferData = prototype.getByteBufferData(); this.streamData = prototype.getStreamData(); this.bodyGenerator = prototype.getBodyGenerator(); this.formParams = prototype.getFormParams() == null ? null : new ArrayList<>(prototype.getFormParams()); this.parts = prototype.getParts() == null ? null : new ArrayList<>(prototype.getParts()); this.virtualHost = prototype.getVirtualHost(); this.length = prototype.getContentLength(); this.proxyServer = prototype.getProxyServer(); this.realm = prototype.getRealm(); this.file = prototype.getFile(); this.followRedirect = prototype.getFollowRedirect(); this.requestTimeout = prototype.getRequestTimeout(); this.rangeOffset = prototype.getRangeOffset(); this.charset = prototype.getBodyCharset(); this.connectionPoolPartitioning = prototype.getConnectionPoolPartitioning(); this.nameResolver = prototype.getNameResolver(); } }