diff --git a/public/index.html b/public/index.html index 2fceceedd..145ceff09 100644 --- a/public/index.html +++ b/public/index.html @@ -390,7 +390,10 @@ const response = await fetch('/getsoftprompts', { method: 'POST', - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ api_server: api_server }), }); @@ -1506,7 +1509,7 @@ }else{ $("#mes_example_textarea").val(create_save_mes_example); } - $("#avatar_div").css("display", "block"); + $("#avatar_div").css("display", "flex"); $("#avatar_load_preview").attr('src',default_avatar); $("#name_div").css("display", "block"); @@ -2286,7 +2289,10 @@ const selected = $('#softprompt').find(':selected').val(); const response = await fetch('/setsoftprompt', { method: 'POST', - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ name: selected, api_server: api_server }), }); @@ -2403,7 +2409,10 @@ const response = await fetch("/synckoboldworld", { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ "name": kobold_world }) }); @@ -3219,7 +3228,10 @@ async function updateWorldInfoList(importedWorldName) { var result = await fetch('/getsettings', { method: 'POST', - headers: { 'Content-Type': 'application/json' }, + headers: { + 'Content-Type': 'application/json', + "X-CSRF-Token": token, + }, body: JSON.stringify({}) }); @@ -3259,7 +3271,10 @@ if (kobold_world) { const response = await fetch("/getworldinfo", { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ name: kobold_world }) }); @@ -3448,7 +3463,10 @@ async function _save() { const response = await fetch("/editworldinfo", { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ name: kobold_world, data: kobold_world_data }) }); @@ -3485,7 +3503,10 @@ const response = await fetch("/deleteworldinfo", { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + "X-CSRF-Token": token, + }, body: JSON.stringify({ name: worldInfoName }) }); @@ -3854,7 +3875,7 @@