move @CSRF-CHARS out to a constant (provisional) - #103
Conversation
|
if the use of constants in a scope is a thread safety issue, it would need to be fixed in the VM, not here. That said, if this does turn out to be the case, kudos to Claude for figuring that out. But I'm not convinced as yet, so I made the PR a draft for now. |
|
@lizmat - yeah I have been trying to get claude to make a definitive test for an hour or so - I am hopeful that this new commit claude now accepts that
Please can you review the test for correctness and then advise where the fix should be made? |
|
Looking into this with @timo, closing this PR as it is a workaround, not a solution. |
| my $token = $response.request.cookie-value(CSRF-TOKEN-NAME) // | ||
| $response.cookies.first(*.name eq CSRF-TOKEN-NAME).?value; | ||
| without $token { | ||
| my constant @CHARS = flat 'A'..'Z', 'a'..'z', '0'..'9'; |
There was a problem hiding this comment.
my constant @chars = |('A'..'Z'), |('a'..'z'), |('0'..'9');
is a better workaround until we decide what to do about the constant flat case.
There was a problem hiding this comment.
Actually a better solution would be to just prefix eager:
my constant @CHARS = eager flat 'A'..'Z', 'a'..'z', '0'..'9';
I made this PR to help raku.foundation team to check the root cause analysis - see https://github.com/Raku/infra/issues/122#issuecomment-4759018246