Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unify get request for proxy/non-proxy
ecosystem host confused by the http/1.0 attempt there
(used to work fine against feather)
  • Loading branch information
coke committed May 19, 2015
1 parent f704eda commit 6ed4ca0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/build/panda-state.p6
Expand Up @@ -37,12 +37,11 @@ sub fetch-projects-json($to) {
if %*ENV<http_proxy> {
my ($host, $port) = %*ENV<http_proxy>.split('/').[2].split(':');
$s = IO::Socket::INET.new(host=>$host, port=>$port.Int);
$s.send("GET http://ecosystem-api.p6c.org/projects.json HTTP/1.1\nHost: ecosystem-api.p6c.org\nAccept: */*\nConnection: Close\n\n");
}
else {
$s = IO::Socket::INET.new(:host<ecosystem-api.p6c.org>, :port(80));
$s.send("GET /projects.json HTTP/1.0\n\n");
}
$s.send("GET http://ecosystem-api.p6c.org/projects.json HTTP/1.1\nHost: ecosystem-api.p6c.org\nAccept: */*\nConnection: Close\n\n");
my ($buf, $g) = '';
$buf ~= $g while $g = $s.get;

Expand Down

0 comments on commit 6ed4ca0

Please sign in to comment.