diff options
author | lolcat <will@lolcat.ca> | 2023-10-17 17:58:08 -0400 |
---|---|---|
committer | lolcat <will@lolcat.ca> | 2023-10-17 17:58:08 -0400 |
commit | 64b090ee058953aed2246967332c7f0b6623cd8f (patch) | |
tree | 5ce457a9a7d96e0164cc9c1734acb1f4e7ab702a | |
parent | 453b4310e2deea984182f6d3c78c974ba8a9f8d6 (diff) |
fix cookie big
-rw-r--r-- | lib/captcha_gen.php | 2 | ||||
-rw-r--r-- | settings.php | 5 | ||||
-rw-r--r-- | static/client.js | 9 |
3 files changed, 11 insertions, 5 deletions
diff --git a/lib/captcha_gen.php b/lib/captcha_gen.php index bb3456d..80bc665 100644 --- a/lib/captcha_gen.php +++ b/lib/captcha_gen.php @@ -166,7 +166,7 @@ class captcha{ $key, [ "expires" => time() + 86400, // expires in 24 hours - "samesite" => "Strict", + "samesite" => "Lax", "path" => "/" ] ); diff --git a/settings.php b/settings.php index 98e6b49..41322d6 100644 --- a/settings.php +++ b/settings.php @@ -278,7 +278,7 @@ foreach($loop as $key => $value){ "", [ "expires" => -1, // removes cookie - "samesite" => "Strict", + "samesite" => "Lax", "path" => "/" ] ); @@ -303,7 +303,8 @@ foreach($loop as $key => $value){ $value, [ "expires" => strtotime("+400 days"), // maximal cookie ttl in chrome - "samesite" => "Strict" + "samesite" => "Lax", + "path" => "/" ] ); } diff --git a/static/client.js b/static/client.js index a53cdb6..2e691f8 100644 --- a/static/client.js +++ b/static/client.js @@ -767,7 +767,12 @@ if(searchbox_wrapper.length !== 0){ // make sure we dont fetch same thing twice autocomplete_cache[curvalue] = []; - var res = await fetch("/api/v1/ac?s=" + encodeURIComponent(curvalue) + ac_req_appendix); + var res = await fetch("/api/v1/ac?s=" + (encodeURIComponent(curvalue).replaceAll("%20", "+")) + ac_req_appendix); + if(!res.ok){ + + return; + } + var json = await res.json(); autocomplete_cache[curvalue] = json[1]; @@ -802,7 +807,7 @@ if(searchbox_wrapper.length !== 0){ ac_func = null; getac(); // get results after 100ms of no keystroke resolve(); - }, 300); + }, 200); }); } |