mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Add user_agent
column to search_logs
(#27742)
Add a new column - `user_agent` - to the `SearchLog` table. This column can be null as we are only allowing a the user-agent string to have a max length of 2000 characters. In the case the user-agent string surpasses the max characters allowed, we simply nullify the value, and save/write the log as normal.
This commit is contained in:
@ -46,6 +46,7 @@ class SearchController < ApplicationController
|
||||
|
||||
search_args[:search_type] = :full_page
|
||||
search_args[:ip_address] = request.remote_ip
|
||||
search_args[:user_agent] = request.user_agent
|
||||
search_args[:user_id] = current_user.id if current_user.present?
|
||||
|
||||
if rate_limit_search
|
||||
@ -99,6 +100,7 @@ class SearchController < ApplicationController
|
||||
|
||||
search_args[:search_type] = :header
|
||||
search_args[:ip_address] = request.remote_ip
|
||||
search_args[:user_agent] = request.user_agent
|
||||
search_args[:user_id] = current_user.id if current_user.present?
|
||||
search_args[:restrict_to_archetype] = params[:restrict_to_archetype] if params[
|
||||
:restrict_to_archetype
|
||||
|
Reference in New Issue
Block a user