Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2015 00:29
Show Gist options
  • Save anonymous/ae41051c8c0ffb1cc45c to your computer and use it in GitHub Desktop.
Save anonymous/ae41051c8c0ffb1cc45c to your computer and use it in GitHub Desktop.
[jdv@wieldy p6-http-useragent]$ git diff
diff --git a/lib/HTTP/Cookies.pm6 b/lib/HTTP/Cookies.pm6
index 0923475..0a91fc1 100644
--- a/lib/HTTP/Cookies.pm6
+++ b/lib/HTTP/Cookies.pm6
@@ -41,7 +41,7 @@ my class HTTP::Cookies::Actions {
}
method extract-cookies(HTTP::Response $response) {
- self.set-cookie($_) for $response.field('Set-Cookie').grep({ $_.defined }).flatmap({ "Set-Cookie: $_" });
+ self.set-cookie($_) for $response.field('Set-Cookie').values.grep({ $_.defined }).flatmap({ "Set-Cookie: $_" });
self.save if $.autosave;
}
diff --git a/lib/HTTP/Header.pm6 b/lib/HTTP/Header.pm6
index a8ceeaa..b269048 100644
--- a/lib/HTTP/Header.pm6
+++ b/lib/HTTP/Header.pm6
@@ -35,7 +35,7 @@ our class HTTP::Header::Actions {
}
method field-value($/) {
make $<field-content>
- ?? $<field-content>.Str.split(',')>>.trim !! Nil
+ ?? ($<field-content>.Str.trim) !! Nil
}
}
[jdv@wieldy p6-http-useragent]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment