Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8378510753 for ; Tue, 1 Apr 2014 09:22:35 +0000 (UTC) Received: (qmail 93707 invoked by uid 500); 1 Apr 2014 09:22:34 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 93164 invoked by uid 500); 1 Apr 2014 09:22:29 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 92201 invoked by uid 99); 1 Apr 2014 09:22:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 09:22:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yoramd@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-we0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 09:22:20 +0000 Received: by mail-we0-f180.google.com with SMTP id p61so5795076wes.25 for ; Tue, 01 Apr 2014 02:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type; bh=7Rd+4iK8BlRV2Ujn2wzuLcFBlpbvA4u0yMt/0jG784s=; b=N1sShzphXRfav3yTW7uhaW7n9v7TQzlz8UtqBjZ6Zx0zJrfjOmEiBPIjijCcnJ9Ml6 L3EbSZyD+/bezAmuo4qWVhEy5RRqX7mrgk4e1+AJpzRdmsphhJ6V7ZtvFgErXjbLb+Pe zHjhtEs7IqA2lZzOps8y0I//nwspK4TcJy9pB+OnFrrpe8NKkvt6HFhR9M1UepZ9BLCa 1wVeWNHmeHHgiYCL1xeIsO5fMOr2BcQQXtWTAxNq1OvxoAqzaG0OAnIFW8AzVzTW0ddN 5Oq2O6wLUeEQyByYOmIkz8nrS3msMJW/oVoUpgMht+Clr7KBismQJPzMNpXlG2bCYwg0 pQCw== X-Received: by 10.194.185.148 with SMTP id fc20mr20971329wjc.27.1396344119738; Tue, 01 Apr 2014 02:21:59 -0700 (PDT) Received: from Tibet-2.local ([109.66.133.210]) by mx.google.com with ESMTPSA id cb5sm39206065eeb.18.2014.04.01.02.21.58 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 02:21:58 -0700 (PDT) Date: Tue, 1 Apr 2014 12:21:56 +0300 From: "Yoram Dayagi (Gmail)" To: HttpClient User Discussion Message-ID: In-Reply-To: <533A8340.2000709@krecan.net> References: <533A8340.2000709@krecan.net> Subject: Re: Heades in Async redirect X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="533a8534_741226bb_57b8" X-Virus-Checked: Checked by ClamAV on apache.org --533a8534_741226bb_57b8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Apparently, this is the behaviour of the client. I did something like that, in order to copy the =E2=80=9CRange=E2=80=9D h= eader: builder.setRedirectStrategy(new DefaultRedirectStrategy() =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =40Override =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 public HttpUriReq= uest getRedirect(HttpRequest request, HttpResponse response, HttpContext = context) throws ProtocolException =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Htt= pUriRequest redirectRequest =3D super.getRedirect(request, response, cont= ext); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // = copy =22Range=22 headers, if exist =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Hea= der=5B=5D rangeHeaders =3D request.getHeaders(HttpHeaders.RANGE); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if = (rangeHeaders =21=3D null) =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 for (Header header : rangeHeaders) =7B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 redirectRequest.addHeader(header); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =7D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =7D= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ret= urn redirectRequest; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =7D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =7D); Hope it=E2=80=99s the correct approach. --=C2=A0 Yoram Dayagi (Gmail) Sent with Airmail On April 1, 2014 at 12:15:58 PM, Luk=C3=A1=C5=A1 K=C5=99e=C4=8Dan (lukas=40= krecan.net) wrote: Hi, =20 I am using httpasyncclient 4.0.1 and I am setting custom Accept =20 header. The server returns 302 redirect, the client correctly follows =20 the location header and sends redirect. The trouble is, that Accept =20 header from the original request is not copied to the redirect so the =20 server returns unexpected Content-Type. Is it a bug or am I doing =20 something work=3F =20 Cheers =20 Lukas =20 --------------------------------------------------------------------- =20 To unsubscribe, e-mail: httpclient-users-unsubscribe=40hc.apache.org =20 =46or additional commands, e-mail: httpclient-users-help=40hc.apache.org = =20 --533a8534_741226bb_57b8--