Skip to content
Browse files

This works again in current Rakudo, resolves #7.

  • Loading branch information...
1 parent ad490bf commit 32d366f4e087942eec051cfc9795941f9ff1a4f9 Timothy Totten committed Mar 20, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/HTTP/Easy.pm6
View
12 lib/HTTP/Easy.pm6
@@ -72,33 +72,35 @@ method run
# @headers.push($line);
# }
## This is the temporary workaround.
- my $found-newline;
+ my $found-newline = False;
my $current-line = '';
while $in-headers
{
my $byte = $!connection.read(1);
my $char = $byte.decode;
- if $char ~~ "\n"
+ if $char ~~ "\r" { next; } ## We're not interested in CR.
+ elsif $char ~~ "\n" ## But we are in NL.
{
if $found-newline
{
- $in-headers = False;
+ $in-headers = False;
}
else
{
@headers.push($current-line);
$current-line = '';
- $found-newline = 1;
+ $found-newline = True;
}
}
else
{
+ $found-newline = False;
$current-line ~= $char;
}
}
## End of work around.
- if $.debug { message("Finished parsing headers."); }
+ if $.debug { message("Finished parsing headers: "~@headers.perl); }
my ($method, $uri, $protocol) = $request.split(/\s/);
if (!$protocol) { $protocol = DEFAULT_PROTOCOL; }
unless $method eq any(<GET POST HEAD PUT DELETE>)

0 comments on commit 32d366f

Please sign in to comment.
Something went wrong with that request. Please try again.