From f2b0ac1d1fb8ed484010d2891cc269aa5027cb53 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Sat, 19 Mar 2022 00:45:01 +0000 Subject: [PATCH] Add content-length to redirect FossilOrigin-Name: cb8ac54183d273f9bac78cc484fd690f02c69b92721fd00ea63db5c0fa074eb9 --- src/status.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/status.c b/src/status.c index 81dd4fb..e0e9330 100644 --- a/src/status.c +++ b/src/status.c @@ -67,21 +67,20 @@ int try_post_status(mastodont_t* api) int try_interact_status(mastodont_t* api, char* id) { - struct mstdnt_storage storage; + struct mstdnt_storage storage = { 0 }; if (!(post.itype && id)) return 1; // Pretty up the type if (strcmp(post.itype, "like") == 0) { mastodont_favourite_status(api, id, &storage); - // TODO Cleanup when errors handled - // mastodont_storage_cleanup(&storage); } else if (strcmp(post.itype, "repeat") == 0) { mastodont_reblog_status(api, id, &storage); - // mastodont_storage_cleanup(&storage); } + mastodont_storage_cleanup(&storage); + return 0; } @@ -158,8 +157,10 @@ void status_interact(mastodont_t* api, char** data, size_t data_size) try_interact_status(api, data[0]); - fputs("Status: 302 Found\r\n", stdout); - printf("Location: %s\r\n\r\nRedirecting...", + printf("Status: 302 Found\r\n" + "Location: %s\r\n" + "Content-Length: 14\r\n\r\n" + "Redirecting...", referer ? referer : "/"); }