On Fri, 2012-05-04 at 20:21 +0300, Mugoma Joseph Okomba wrote: > > > > (1) Redirect handling in HC 3.x is utterly and irreparably broken. HC > > 4.x does a much more reasonable job at handling redirects. > > > > Redirects under HC 3.x might be broken but it works. At least I haven't > bumped into the broken nature > > > (2) There is no such thing as undesirable redirects from the HTTP > > protocol standpoint. Redirects are either legal, illegal or legal but > > requiring user intervention. If you want to handle redirects selectively > > (allowing some redirects but disallowing others) you can always > > implement a custom RedirectStrategy and configure HttpClient to use it > > instead of the default one. > > > > The problem with HC 4.x is that it's being detected as a mobile browser. > So when it hits a website the server tries to redirect to a mobile version > if it has. This appears to be the anormally for me. > > Can such behavior be avoided / rectified? >
This problem is very like to have nothing to do with redirects. Some sites react differently to requests with different 'User-Agent' headers. Some might be aware of HttpClient being an HTTP library rather than a browser. Some might be not. If you configure HC 4.x to masquerade itself as HC 3.x the problematic sites are likely to behave more consistently. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
