You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Preethi (Jira)" <ji...@apache.org> on 2020/06/15 09:00:11 UTC

[jira] [Updated] (HTTPCLIENT-2088) Request headers directly copied to the redirect URL

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Preethi updated HTTPCLIENT-2088:
--------------------------------
    Description: 
We are using apache client in our project. 

We are using LaxRedirect strategy for redirect.

 

When we hit the url and it is a redirect, the request headers from the original is copied to the headers of the redirect url as well. The host header is not changed to the url to the redirect server. 

 

 

HttpRequest redirect = this.redirectStrategy.getRedirect(currentRequest.getOriginal(), response, context);
 if (!redirect.headerIterator().hasNext())

{ HttpRequest original = request.getOriginal(); redirect.setHeaders(original.getAllHeaders()); }

 

 

Our redirect server is an S3 bucket

 

  was:
We are using apache client in our project. 

We are using LaxRedirect strategy for redirect.

 

When we hit the url and it is a redirect, the request headers from the original is copied to the headers of the redirect url as well. The host header is not accepted to the redirect server 

 

HttpRequest redirect = this.redirectStrategy.getRedirect(currentRequest.getOriginal(), response, context);
if (!redirect.headerIterator().hasNext()) {
 HttpRequest original = request.getOriginal();
 redirect.setHeaders(original.getAllHeaders());
}

 


> Request headers directly copied to the redirect URL
> ---------------------------------------------------
>
>                 Key: HTTPCLIENT-2088
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2088
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.3
>            Reporter: Preethi
>            Priority: Major
>
> We are using apache client in our project. 
> We are using LaxRedirect strategy for redirect.
>  
> When we hit the url and it is a redirect, the request headers from the original is copied to the headers of the redirect url as well. The host header is not changed to the url to the redirect server. 
>  
>  
> HttpRequest redirect = this.redirectStrategy.getRedirect(currentRequest.getOriginal(), response, context);
>  if (!redirect.headerIterator().hasNext())
> { HttpRequest original = request.getOriginal(); redirect.setHeaders(original.getAllHeaders()); }
>  
>  
> Our redirect server is an S3 bucket
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org