Open Xliff opened 4 years ago
It looks to be the cookie value that's failing. It's not specific to your project, as it looks to be internal to Cro.
FWIW, the value of the cookie looks like this: "2|1:0|10:1575522098|23:username-localhost-8888|44:OWZjMjY4NmNlNjU2NDQ3NGE2YWQ2Zjg5YmE3MzBmNDY
Please note the starting double-quote without one at the end.
Here's a fix for the problem. I think there's a better way to fix it, but now it looks to be a Cro::HTTP issue, not an issue with this project:
diff --git a/lib/Cro/HTTP/Request.pm6 b/lib/Cro/HTTP/Request.pm6
index 988842f..07f3127 100644
--- a/lib/Cro/HTTP/Request.pm6
+++ b/lib/Cro/HTTP/Request.pm6
@@ -165,6 +165,9 @@ class Cro::HTTP::Request does Cro::HTTP::Message {
my @res;
for @str {
my ($name, $value) = $_.split('=');
+ # cw: Horrible fix, but just to see if it works.
+ $value .= substr(1)
+ if $value.starts-with('"') && $value.ends-with('"').not;
@res.push: Cro::HTTP::Cookie.new(:$name, :$value) if $name;
}
@res;
Hi. I just run the sample with latest rakudo and it works as a charm. I also have latest versions of cro deps. I indeed fixed a simple bug, but couldn't reproduce scary exception you got. Can you, please, provide a detailed step by step guide of reproducing this? With versions and so on.
FWIW, there were no steps to reproduce. I followed git instructions and tried to start the blog. The first request caused that exception.
I will try again with latest Rakudo.
I have the same issue
it happens to me when there are some old cookies ... after cookies are cleaned the issue has gone
So I am looking into it after a year, hmm.
What cookie do you have (you posted the value, but not its name) and what origin does it have? The two cookies created by this project are color-theme
and _session
, both of them are not creating what you posted.
For your interest, I admit there was a dumb bug in the cookie value parser when there are two doublequotes, and this is fixed with https://github.com/croservices/cro-http/pull/157
But the issue is that your value (with "
at the beginning and no one at the end) is then bogus and go against RFC 6265. Maybe something important creates such bogus set-cookie commands and we have to comply for the sake of backward compat, but unless we know what creates them we don't know if we should.
Hi! t's hard to reproduce, as i said , the issue had gone after i cleaned the cookie . all i know.
my suggestion is cro would give more human readable information in that case, apparently the message i saw in a log, similar to what you had does not help to troubleshoot the problem ...
Here is the full exception message: