elasticsearch/elasticsearch — Issue #1432: plugin script fails to follow github redirect
Author: glynnbird
Created: 2011-10-28 21:05:25+00:00
State: open

The plugin installation script fails if GitHub decides not to serve out zip files directly but through a HTTP 302 re-direct.

````$ ./bin/plugin -install mobz/elasticsearch-head
-> Installing mobz/elasticsearch-head...
Trying https://github.com/downloads/mobz/elasticsearch-head/elasticsearch-head-0.18.1.zip...
Trying https://github.com/mobz/elasticsearch-head/zipball/v0.18.1...
Trying https://github.com/mobz/elasticsearch-head/zipball/master...
Failed to install mobz/elasticsearch-head, reason: failed to download
````
The first two attempts would fail (because those files don't exist) but the master one should succeed. Trying with curl reveals that GitHub is in the mood to redirect requests to another server:

````$ curl -i 'https://github.com/mobz/elasticsearch-head/zipball/master'
HTTP/1.1 302 Found
Server: nginx/1.0.4
Date: Fri, 28 Oct 2011 10:40:08 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 302 Found
X-Frame-Options: deny
Location: https://nodeload.github.com/mobz/elasticsearch-head/zipball/master
X-Runtime: 8ms
Content-Length: 132
Set-Cookie: _gh_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--ed7eadd474fd37850b68bd3c08a5c55ad0c3c833; path=/; expires=Fri, 01 Jan 2021 00:00:00 GMT; secure; HttpOnly
Cache-Control: no-cache
Strict-Transport-Security: max-age=2592000
````

Perhaps the plugin installation script should be follow the redirect.