HTTP Repository doesn't like full URLs in the links #26

Closed
preaction opened this Issue Jan 23, 2013 · 5 comments

3 participants

@preaction

I've got a repository that puts its builds on a different server from the build list page. This causes the file URL to be something like:

http://example.com/mylocation/http://build.example.com/build/tarball.tar.gz

I've started some work on fixing this (https://github.com/preaction/Alien-Base/tree/http_full_urls), but it seems to be bigger than I thought. What are your suggestions for how I should change the API to fix this? Repository::get_files() would have to change, at the very least.

@jberger
Perl5-Alien member

Do these changes help? They are recent additions (not sure how well documented). I really need to spend some tuits on this. #22

@preaction

Not yet, no. It just trades one set of problems for another (full URLs work, but relative URLs do not).

One way to go about it could be to assemble a URI object and give that to get_files(). Then get_files() could return the path to the file it downloaded. That way, it wouldn't matter what repository was being used, the caller would get exactly what it wanted: The path to the file(s) it needs. That, or get_files() could always take a full URI as a string and return the file path.

Either way, the caller shouldn't make any assumptions about where the file it wants is going to end up. Of course, the repository should use the alien_temp folder for what it does, but the file downloaded may not be named using the URL being requested if the UA gets redirected or if the response has a Content-Disposition header.

@zmughal
Perl5-Alien member

Looking at this now... the modifying of get_file is the approach I took with this PR #31.

@zmughal
Perl5-Alien member

By the way, this issue should be closed as PR #31 has been merged! :-)

@preaction

This appears to fix my case, so agreed.

@preaction preaction closed this Apr 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment