Created
August 25, 2011 20:13
-
-
Save cosimo/1171761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/Cookie.pm b/lib/Mojo/Cookie.pm | |
index 6a67e42..ed42fe5 100644 | |
--- a/lib/Mojo/Cookie.pm | |
+++ b/lib/Mojo/Cookie.pm | |
@@ -22,6 +22,7 @@ my $NAME_RE = qr/ | |
/x; | |
my $SEPARATOR_RE = qr/^\s*\;\s*/; | |
my $VALUE_RE = qr/^([^\;\,]+)\s*/; | |
+my $VALUE_NOCOMMA_RE = qr/^([^\;]+)\s*/; | |
# "My Homer is not a communist. | |
# He may be a liar, a pig, an idiot, a communist, | |
@@ -44,7 +45,15 @@ sub _tokenize { | |
if ($name =~ /expires/i && $string =~ s/$EXPIRES_RE//o) { $value = $1 } | |
# Value | |
- elsif ($string =~ s/$VALUE_RE//o) { $value = $1 } | |
+ | |
+ # Salesforce uses cookie values containing commas | |
+ elsif ($name =~ /^__kt[isvt]$/ && $string =~ s/$VALUE_NOCOMMA_RE//o) { | |
+ $value = $1 | |
+ } | |
+ | |
+ elsif ($string =~ s/$VALUE_RE//o) { | |
+ $value = $1 | |
+ } | |
# Token | |
push @token, [$name, $value]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment