Skip to content

Small issues #52

@sehraf

Description

@sehraf

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

  • the content type of REST request is not application/json
  • the code for sending a chat message is using rsmsgs as URL (which should be rsMsgs)

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);
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions