DEV: Ignore invalid tag parameter in TagsController (#28557)

This had no effect in the app, but it was resulting in errors in the logs.
This commit is contained in:
Penar Musaraj 2024-08-27 12:06:54 -04:00 committed by GitHub
parent f405c021eb
commit ee3b175373
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -585,6 +585,6 @@ class TagsController < ::ApplicationController
end
def tag_params
Array(params[:tags]).concat(Array(@additional_tags))
Array(params[:tags]).map(&:to_s).concat(Array(@additional_tags))
end
end

View File

@ -518,6 +518,11 @@ RSpec.describe TagsController do
expect(topic_ids).to_not include(topic_in_subcategory_without_tag.id)
end
end
it "should ignore invalid tag parameter" do
get "/tag/test.json?tags[0]=nada"
expect(response.status).to eq(200)
end
end
describe "#info" do