From af342b3bd09d773ad1763d2559776f10c31f5690 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Wed, 29 May 2024 20:39:52 +0530 Subject: [PATCH] SimpleChat: Allow Authorization header to be set by end user --- examples/server/public_simplechat/simplechat.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 01951afe1..a2061e61b 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -728,6 +728,8 @@ class Me { ui.el_create_append_p(`baseURL:${this.baseURL}`, elDiv); + ui.el_create_append_p(`Authorization:${this.headers["Authorization"]}`, elDiv); + ui.el_create_append_p(`bStream:${this.bStream}`, elDiv); ui.el_create_append_p(`bCompletionFreshChatAlways:${this.bCompletionFreshChatAlways}`, elDiv); @@ -755,6 +757,11 @@ class Me { }); elDiv.appendChild(inp); + inp = ui.el_creatediv_input("SetAuthorization", "Authorization", "text", this.headers["Authorization"], (val)=>{ + this.headers["Authorization"] = val; + }); + elDiv.appendChild(inp); + let bb = ui.el_creatediv_boolbutton("SetStream", "Stream", {true: "[+] yes stream", false: "[-] do oneshot"}, this.bStream, (val)=>{ this.bStream = val; });