Skip Menu |

This queue is for tickets about the REST-Client CPAN distribution.

Report information
The Basics
Id: 65804
Status: open
Priority: 0/
Queue: REST-Client

People
Owner: Nobody in particular
Requestors: jeffery [...] astraaustralis.com.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 171
Fixed in: (no value)



Subject: Leaving Follow at default prevents authentication from working
If you don't set Follow to true then the module uses LWP::UserAgent's simple_request method. This means authentication does not work. The culprit is this line my $res = $self->getFollow ? $ua->request($req) : $ua->simple_request($req); Attempts to use authentication without setting Follow to true fail as the server rejects the requests. Yet the authentication details have been set correctly in the useragent. There is no indication as to what the real failure is.
Thanks, I'll take a look soon. On Wed Feb 16 22:37:33 2011, JEFFERY wrote: Show quoted text
> If you don't set Follow to true then the module uses LWP::UserAgent's > simple_request method. This means authentication does not work. The > culprit is this line > > my $res = $self->getFollow ? $ua->request($req) : $ua- >simple_request($req); > > Attempts to use authentication without setting Follow to true fail as > the server rejects the requests. Yet the authentication details have > been set correctly in the useragent. There is no indication as to what > the real failure is.
This is irritating - LWP does not separate handling of authentication from handling of redirects. The default in rest::client is set to not follow because it is often desirable to see redirect status codes when working with a resource - you often want to update your client state as a result. I didn't realize that simple_request() did not handle any authentication scheme, and I don't see a way to get it request() to handle authentication without handling simple redirects. hmm, -m On Thu Feb 17 00:47:36 2011, MCRAWFOR wrote: Show quoted text
> Thanks, I'll take a look soon. > > On Wed Feb 16 22:37:33 2011, JEFFERY wrote:
> > If you don't set Follow to true then the module uses
LWP::UserAgent's Show quoted text
> > simple_request method. This means authentication does not work. The > > culprit is this line > > > > my $res = $self->getFollow ? $ua->request($req) : $ua- > >simple_request($req); > > > > Attempts to use authentication without setting Follow to true fail
as Show quoted text
> > the server rejects the requests. Yet the authentication details have > > been set correctly in the useragent. There is no indication as to
what Show quoted text
> > the real failure is.
>