Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraction of authorization from URL needs to happen sooner [rt.cpan.org #89968] #56

Open
oalders opened this issue Mar 31, 2017 · 0 comments

Comments

@oalders
Copy link
Member

oalders commented Mar 31, 2017

Migrated from rt.cpan.org#89968 (status was 'new')

Requestors:

From leonerd-cpan@leonerd.org.uk on 2013-11-01 22:12:56:

The HTTP::Request + LWP::UserAgent pair of modules correctly handles the case

  my $resp = $ua->request( GET "http://user:pass@host/path" );

but despite that the HTTP basic auth header is a property of the HTTP::Request itself, this appears to be being handled entirely by LWP rather than HTTP::Request.

It would be more useful for other HTTP useragents which are based on HTTP::Message objects if this were handled within HTTP::Request itself. I feel that therefore the behaviour ought to be somewhere that after

  my $req = GET "http://user:pass@host/path";

We now have the Authorization header correctly set in $req and the user:pass@ removed from the embedded URL in the first request line. Ideally then at this point

  print $req->as_string;

should yield

  GET /path HTTP/1.1
  Host: host
  Authorization: Basic dXNlcjpwYXNz
  ...

-- 

Paul Evans

From leonerd-cpan@leonerd.org.uk on 2013-11-06 17:06:11:

For context see also

  https://rt.cpan.org/Ticket/Display.html?id=89775

-- 

Paul Evans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant