From 95a87d0707f365eac4c9c14367bed933ecfd18a6 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 23 Nov 2021 23:53:00 -0500 Subject: [PATCH] Revert previous commit because it didn't work. Furthermore, remove the content-length header from the PUT operation because the browser wants to do that on its own. --- webcit-ng/messages.c | 7 ------- webcit-ng/static/js/view_forum.js | 9 --------- 2 files changed, 16 deletions(-) diff --git a/webcit-ng/messages.c b/webcit-ng/messages.c index 597e5f0d3..adc4260ad 100644 --- a/webcit-ng/messages.c +++ b/webcit-ng/messages.c @@ -136,7 +136,6 @@ void dav_get_message(struct http_transaction *h, struct ctdlsession *c, long msg void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *euid, long old_msgnum) { char buf[1024]; char *content_type = NULL; - char *content_transfer_encoding = NULL; int n; long new_msgnum; char new_euid[1024]; @@ -160,12 +159,6 @@ void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *eu content_type = header_val(h, "Content-type"); ctdl_printf(c, "Content-type: %s\r\n", (content_type ? content_type : "application/octet-stream")); - - content_transfer_encoding = header_val(h, "Content-Transfer-Encoding"); - if (!IsEmptyStr(content_transfer_encoding)) { - ctdl_printf(c, "Content-Transfer-Encoding: %s\r\n", content_transfer_encoding); - } - ctdl_printf(c, "\r\n"); ctdl_write(c, h->request_body, h->request_body_length); if (h->request_body[h->request_body_length] != '\n') { diff --git a/webcit-ng/static/js/view_forum.js b/webcit-ng/static/js/view_forum.js index fb9121b58..56b6a589b 100644 --- a/webcit-ng/static/js/view_forum.js +++ b/webcit-ng/static/js/view_forum.js @@ -263,14 +263,6 @@ function cancel_post(div_name) { } -// Save the posted message to the server -function Xsave_message(div_name, reply_to_msgnum) { - msg_text = "" + document.getElementById("ctdl-editor-body").innerHTML + "\n"; - m = btoa(msg_text); - alert(m); -} - - // Save the posted message to the server function save_message(div_name, reply_to_msgnum) { msg_text = "" + document.getElementById("ctdl-editor-body").innerHTML + "\n"; @@ -279,7 +271,6 @@ function save_message(div_name, reply_to_msgnum) { var request = new XMLHttpRequest(); request.open("PUT", url, true); request.setRequestHeader("Content-type", "text/html"); - request.setRequestHeader("Content-length", msg_text.length); request.onreadystatechange = function() { if (request.readyState == 4) { if (Math.trunc(request.status / 100) == 2) { -- 2.39.2