From 69f88a832cab80211e5ba99bab8da5fa4ebdae6a Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sat, 21 Nov 2026 17:31:43 +0900 Subject: [PATCH] Request context menus with POST to keep the authenticity token out of the URL The context menu request serializes the whole form, which includes the authenticity_token field. Since the request was sent with GET, the token ended up in the query string and therefore in web server and application logs. Sending the request with POST moves it to the request body. All context menu routes already accept POST. Also declare the expected response type explicitly so that jQuery does not guess it from the Content-Type of the response. Co-Authored-By: Claude Mythos 5.2 --- app/assets/javascripts/context_menu.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/context_menu.js b/app/assets/javascripts/context_menu.js index 7feb6038a..b8878d852 100644 --- a/app/assets/javascripts/context_menu.js +++ b/app/assets/javascripts/context_menu.js @@ -120,6 +120,8 @@ function contextMenuShow(event) { $.ajax({ url: url, + type: 'post', + dataType: 'html', data: $(event.target).parents('form').first().serialize(), success: function(data, textStatus, jqXHR) { $('#context-menu').html(data); -- 2.55.0