Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix http protocol #8

Merged
merged 1 commit into from

2 participants

@jtpalmer

It looks like Alien::Base::ModuleBuild::Repository::HTTP wasn't using the URI module properly. This commit adds 'http' as the schema and removes the use of $uri->abs.

If the href's found by find_links are not relative, they may not be handled properly. I'll submit another pull request if I can fix that.

@jberger
Owner

This seems reasonable, as I mentioned on IRC (now here for posterity), I haven't spent much time on the HTTP handler yet. I will merge this to help you progress with your work. Of course I reserve the right to change any part of the internals and the API isn't stable yet so use it with that knowledge.

Thanks for the help! I hope to see your Alien:: module soon!

@jberger jberger merged commit 07914e2 into from
@jberger
Owner

Oops, I just released version 0.000_008 from my local branch and this wasn't merged. Sorry. It will be in the 0.000_009 dev release for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 6, 2012
  1. @jtpalmer

    Fix http protocol

    jtpalmer authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 6 deletions.
  1. +5 −6 lib/Alien/Base/ModuleBuild/Repository/HTTP.pm
View
11 lib/Alien/Base/ModuleBuild/Repository/HTTP.pm
@@ -42,7 +42,7 @@ sub get_file {
my $host = $self->{host};
my $from = $self->location;
- my $response = $self->connection->mirror( $host . $from . $file, $file );
+ my $response = $self->connection->mirror('http://' . $host . $from . '/' . $file, $file );
croak "Download failed: " . $response->{reason} unless $response->{success};
return 1;
@@ -52,18 +52,17 @@ sub list_files {
my $self = shift;
my $host = $self->host;
- my $uri = URI->new($host);
+ my $location = $self->location;
+ my $uri = URI->new('http://' . $host . $location);
- my $res = $self->connection->get($uri->abs($self->location));
+ my $res = $self->connection->get($uri);
unless ($res->{success}) {
carp $res->{reason};
return ();
}
- my @links =
- map { $uri->abs($_) }
- $self->find_links($res->{content});
+ my @links = $self->find_links($res->{content});
return @links;
}
Something went wrong with that request. Please try again.