Box adding via HTTP follows redirects [closes GH-163]

This commit is contained in:
Mitchell Hashimoto 2010-12-31 01:40:30 -06:00
parent b33e4002ff
commit 6b74ad103d
3 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,7 @@
## 0.7.0.beta2 (unreleased)
- Use numeric uid/gid in mounting shared folders to increase portability. [GH-252]
- HTTP downloading follows redirects. [GH-163]
## 0.7.0.beta (December 24, 2010)

View File

@ -26,6 +26,14 @@ module Vagrant
http.start do |h|
h.request_get(uri.request_uri) do |response|
if response.is_a?(Net::HTTPRedirection)
# Follow the HTTP redirect.
# TODO: Error on some redirect limit
env.ui.info I18n.t("vagrant.downloaders.http.follow_redirect", :url => response["Location"])
download!(response["Location"], destination_file)
return
end
total = response.content_length
progress = 0
segment_count = 0

View File

@ -403,6 +403,7 @@ en:
file:
file_missing: "The specified path to a file doesn't exist."
http:
follow_redirect: "Download following redirect: %{url}"
socket_error: |-
An error occurred while trying to download the specified box. This most
often happens if there is no internet connection or the address is