Fix #5227: Error on note previews due to URL length limit

Allow either GET or POST for /note_previews.
This commit is contained in:
evazion
2022-08-24 16:27:05 -05:00
parent 4215d5ed86
commit 3f10eeb954
3 changed files with 4 additions and 2 deletions

View File

@@ -11,4 +11,6 @@ class NotePreviewsController < ApplicationController
end
end
end
alias_method :create, :show
end

View File

@@ -526,7 +526,7 @@ class Note {
async preview_text(text) {
this.display_text("Loading...");
let response = await $.getJSON("/note_previews", { body: text });
let response = await $.post("/note_previews", { body: text });
this.display_text(response.body);
this.initialize();

View File

@@ -172,7 +172,7 @@ Rails.application.routes.draw do
end
end
resources :note_versions, :only => [:index, :show]
resource :note_previews, :only => [:show]
resource :note_previews, only: [:create, :show]
resource :password_reset, only: [:create, :show]
resources :pixiv_ugoira_frame_data, only: [:index]
resources :pools do