Perl5-Alien / Alien-Base

Base classes for Alien:: modules (deprecated, see Alien-Build)
Other
35 stars 19 forks source link

Use the base_url from the request #151

Closed plicease closed 8 years ago

plicease commented 8 years ago

This fixes #150

Briefly, the problem is that if you provide something like

"/foo/bar"

as the location, and that location is a directory, then the remote server will redirect you to "/foo/bar/" before returning the directory listing. LWP::UserAgent or HTTP::Tiny will do this for you, but if you use "/foo/bar" as the base_url then any relative URLs will be wrong.

Ideally AB modules should specify "/foo/bar/" but this is an easy fix for modules that do not.

plicease commented 8 years ago

/cc: @salva this is related to #144

I tested a number of dists before applying that PR, but obviously all of them had the trailing / in the location field.

zmughal commented 8 years ago

This seems reasonable to me. And if it works with Alien-Chipmunk as mentioned in #150, I think that's good enough of a test.

Merge: Aye

plicease commented 8 years ago

Yup. It fixes Alien::Chipmunk, I even tested with protocol_class=LWP::UserAgent

jberger commented 8 years ago

certainly it shouldn't matter if someone appends a trailing slash, aye!

plicease commented 8 years ago

Testing with some other distros (with and without the /) and will do a production release shortly.