RetroShare / RSNewWebUI

30 stars 20 forks source link

Small issues #52

Open sehraf opened 2 years ago

sehraf commented 2 years ago

I've encountered a few issues whhile working on rustyshare:

Here is a patch

diff --git a/webui-src/app/chat/chat.js b/webui-src/app/chat/chat.js
index aab96e9..39564cf 100644
--- a/webui-src/app/chat/chat.js
+++ b/webui-src/app/chat/chat.js
@@ -212,7 +212,7 @@ const ChatLobbyModel = {
   },
   sendMessage(msg, onsuccess) {
     rs.rsJsonApiRequest(
-      '/rsmsgs/sendChat',
+      '/rsMsgs/sendChat',
       {},
       () => {
         // adding own message to log
diff --git a/webui-src/app/rswebui.js b/webui-src/app/rswebui.js
index 773b297..3505985 100644
--- a/webui-src/app/rswebui.js
+++ b/webui-src/app/rswebui.js
@@ -28,6 +28,7 @@ function rsJsonApiRequest(
   config = null
 ) {
   headers['Accept'] = 'application/json';
+  headers['content-type'] = 'application/json';
   if (loginKey.isVerified) {
     headers['Authorization'] = 'Basic ' + btoa(loginKey.username + ':' + loginKey.passwd);
   }
zelfroster commented 1 year ago

This issue can be closed, as I checked that sending requests even with different case seems to work without any issue, for e.g rsfiles/rsFiles both work. And for the 2nd issue, we don't need to mention content-type unless the request is of PUT or POST type. I read this on this Stack Overflow thread https://stackoverflow.com/a/16693884/16184838

So, I guess we can close this issue @csoler.