You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "oliver z (JIRA)" <ji...@apache.org> on 2010/05/27 08:53:37 UTC

[jira] Created: (HTTPCLIENT-945) HttpClient does not follow 302

HttpClient does not follow 302 
-------------------------------

                 Key: HTTPCLIENT-945
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
             Project: HttpComponents HttpClient
          Issue Type: Bug
    Affects Versions: 4.1 Alpha2, 4.0.1
         Environment: Win7, Netbeans 6.8, JDK6_20
            Reporter: oliver  z


i have a server which gives me a authentication string in the request header. with that i can connect to my streamserver and download a video file eg. mp3/avi...

my server sends:
[X-Powered-By=PHP/5.2.11, 
Cache-Control=no-cache, no-store, must-revalidate, 
Pragma=no-cache, 
Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
Content-Type=audio/mpeg, 
Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
Content-Length=0,
Connection=close, 
Date=Wed, 26 May 2010 16:17:40 GMT, 
Server=lighttpd/1.5.0]

this is the 302 (says wireshark) but HttpClient will just not follow
but it must because the headers etc. are used for authentication 
how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872275#action_12872275 ] 

oliver  z edited comment on HTTPCLIENT-945 at 5/27/10 3:15 PM:
---------------------------------------------------------------

well thats sad.. because i dont know any browser which does not work (FF, IE, Opera, ..) 
then i have to do this myself 

thats the code that works for me - if someone has an equal problem

# HttpClient client = new HttpClient();  
# client.setRedirectStrategy(new DefaultRedirectStrategy() {  
#   
#             @Override  
#             public boolean isRedirected(HttpRequest hr, HttpResponse hr1, HttpContext hc) {  
#                 if (hr1.getStatusLine().getStatusCode() == 302) {  
#                     return true;  
#                 }  
#                 return false;  
#             }  
#   
#             @Override  
#             public HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context) {  
#                 HttpGet get = null;  
#                 try {  
#   
#                     String newLocation = "" + response.getFirstHeader("Location");  
#                     newLocation = newLocation.substring(newLocation.indexOf("Location:")+10);  
#                     get = new HttpGet(newLocation);  
#   
#   
#                 } catch (Exception ex) {  
#                     System.out.println(ex.getLocalizedMessage());  
#                 }  
#                 return get;  
#             }  
#         });     

      was (Author: olze84):
    well thats sad.. because i dont know any browser which does not work (FF, IE, Opera, ..) 
then i have to do this myself 

i have now overwritten the isRedirected and it works, but can you help me with the getRedirect method?

            public HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context) {
                HttpGet retVal = (HttpGet) request;
                try {
                    String newLocation = "" + response.getFirstHeader("Location");
                    retVal.setURI(new URI(newLocation));

                } catch (Exception ex) {
                    System.out.println(ex.getLocalizedMessage());
                }
                return retVal;
            }
        });

is not working, i get a cast exception... but when i use HttpUriRequest i cant set the new url
  
> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

oliver  z updated HTTPCLIENT-945:
---------------------------------

    Attachment:     (was: debug.log)

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872275#action_12872275 ] 

oliver  z commented on HTTPCLIENT-945:
--------------------------------------

well thats sad.. because i dont know any browser which does not work (FF, IE, Opera, ..) 
then i have to do this myself 


> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

oliver  z updated HTTPCLIENT-945:
---------------------------------

    Attachment:     (was: debug.log)

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872393#action_12872393 ] 

Oleg Kalnichevski commented on HTTPCLIENT-945:
----------------------------------------------

> i dont know any browser which does not work (FF, IE, Opera, ..) 

HttpClient is not a browser.

> # newLocation = newLocation.substring(newLocation.indexOf("Location:")+10); 

This does not seem right.

Why do need to override #getRedirect at all? Anyway, you should be using #getLocationURI method to extract redirect location.

Oleg

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

oliver  z updated HTTPCLIENT-945:
---------------------------------

    Attachment:     (was: debug.log)

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-945.
------------------------------------------

    Resolution: Invalid

Per section 10.3.3 of RFC 2616 responses 302 (FOUND) to any method other than GET or HEAD may not be redirected automatically. Your method is POST.

If you want to override this standard compliant behaviour you can provide a custom RedirectHandler in version 4.0.x or a custom RedirectStrategy in version 4.1  

Oleg

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872170#action_12872170 ] 

Oleg Kalnichevski commented on HTTPCLIENT-945:
----------------------------------------------

Generate a complete wire / context log of the HTTP session as described here [1] and attach it to the report.

Oleg

[1] http://hc.apache.org/httpcomponents-client-4.0.1/logging.html



> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

oliver  z updated HTTPCLIENT-945:
---------------------------------

    Description: 
i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...

my server sends:
[X-Powered-By=PHP/5.2.11, 
Cache-Control=no-cache, no-store, must-revalidate, 
Pragma=no-cache, 
Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
Content-Type=audio/mpeg, 
Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
Content-Length=0,
Connection=close, 
Date=Wed, 26 May 2010 16:17:40 GMT, 
Server=lighttpd/1.5.0]

this is the 302 (says wireshark) but HttpClient will just not follow
but it must because the headers etc. are used for authentication 
how can i achieve that?

  was:
i have a server which gives me a authentication string in the request header. with that i can connect to my streamserver and download a video file eg. mp3/avi...

my server sends:
[X-Powered-By=PHP/5.2.11, 
Cache-Control=no-cache, no-store, must-revalidate, 
Pragma=no-cache, 
Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
Content-Type=audio/mpeg, 
Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
Content-Length=0,
Connection=close, 
Date=Wed, 26 May 2010 16:17:40 GMT, 
Server=lighttpd/1.5.0]

this is the 302 (says wireshark) but HttpClient will just not follow
but it must because the headers etc. are used for authentication 
how can i achieve that?


> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872403#action_12872403 ] 

oliver  z commented on HTTPCLIENT-945:
--------------------------------------

thanks for your replay
i changed the code as you mentioned and it works - thx :) (i was sure there is such a method but i didnt find it and time pressure forces me to continue with other parts of the project))

i have overwritten the isRedirect because i thought thats what is beeing checked (if its POST and 302 -> return false and dont follow)

> HttpClient is not a browser. 
you are right, but it would be nice if there would be such a option like setCompatibility(Mode.FIREFOX3)  :)



> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12872275#action_12872275 ] 

oliver  z edited comment on HTTPCLIENT-945 at 5/27/10 1:48 PM:
---------------------------------------------------------------

well thats sad.. because i dont know any browser which does not work (FF, IE, Opera, ..) 
then i have to do this myself 

i have now overwritten the isRedirected and it works, but can you help me with the getRedirect method?

            public HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context) {
                HttpGet retVal = (HttpGet) request;
                try {
                    String newLocation = "" + response.getFirstHeader("Location");
                    retVal.setURI(new URI(newLocation));

                } catch (Exception ex) {
                    System.out.println(ex.getLocalizedMessage());
                }
                return retVal;
            }
        });

is not working, i get a cast exception... but when i use HttpUriRequest i cant set the new url

      was (Author: olze84):
    well thats sad.. because i dont know any browser which does not work (FF, IE, Opera, ..) 
then i have to do this myself 

  
> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-945) HttpClient does not follow 302

Posted by "oliver z (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

oliver  z updated HTTPCLIENT-945:
---------------------------------

    Attachment: debug.log

> HttpClient does not follow 302 
> -------------------------------
>
>                 Key: HTTPCLIENT-945
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-945
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0.1, 4.1 Alpha2
>         Environment: Win7, Netbeans 6.8, JDK6_20
>            Reporter: oliver  z
>         Attachments: debug.log
>
>
> i have a server which gives me a authentication string in the response header. with that i can connect to my streamserver and download a video file eg. mp3/avi...
> my server sends:
> [X-Powered-By=PHP/5.2.11, 
> Cache-Control=no-cache, no-store, must-revalidate, 
> Pragma=no-cache, 
> Expires=Sat, 26 Jul 2010 05:00:00 GMT, 
> Content-Type=audio/mpeg, 
> Location=http://mysub.myhost.com/3728/20713728.avi?__dd1__=1274891260, 
> Content-Length=0,
> Connection=close, 
> Date=Wed, 26 May 2010 16:17:40 GMT, 
> Server=lighttpd/1.5.0]
> this is the 302 (says wireshark) but HttpClient will just not follow
> but it must because the headers etc. are used for authentication 
> how can i achieve that?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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