ensure useragent is not null
This commit is contained in:
parent
dac8ef2283
commit
43f3301237
@ -73,7 +73,7 @@ class ApplicationController < ActionController::Base
|
||||
APIUsage.create!(
|
||||
user_id: CurrentUser.is_anonymous? ? nil : CurrentUser.id,
|
||||
api_key: @apikey.nil? || @apikey.is_anon? ? nil : @apikey,
|
||||
user_agent: request.headers["user-agent"],
|
||||
user_agent: request.headers["user-agent"] || "",
|
||||
method: request.method,
|
||||
path: request.path,
|
||||
params: request.params.to_json,
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ExceptionsController < ApplicationController
|
||||
def index
|
||||
@pagy, @exceptions = pagy(ExceptionLog.order(id: :desc), items: 25)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PoolIndex
|
||||
module_function
|
||||
|
||||
|
@ -35,7 +35,7 @@ class APIImage < ApplicationRecord
|
||||
invalidate_cache
|
||||
end
|
||||
|
||||
def file_header_info(file_path)
|
||||
def file_header_info(file_path)
|
||||
File.open(file_path) do |bin|
|
||||
mime_type = Marcel::MimeType.for(bin)
|
||||
ext = case mime_type
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class Pool < ApplicationRecord
|
||||
self.table_name = "e621.pools"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class Post < ApplicationRecord
|
||||
self.table_name = "e621.posts"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class Tag < ApplicationRecord
|
||||
self.table_name = "e621.tags"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class TagAlias < ApplicationRecord
|
||||
self.table_name = "e621.tag_aliases"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class TagImplication < ApplicationRecord
|
||||
self.table_name = "e621.tag_implications"
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module E621
|
||||
class WikiPage < ApplicationRecord
|
||||
self.table_name = "e621.wiki_pages"
|
||||
|
@ -8,7 +8,7 @@ class ExceptionLog < ApplicationRecord
|
||||
host: Socket.gethostname,
|
||||
params: request.filtered_parameters,
|
||||
referrer: request.referrer,
|
||||
user_agent: request.user_agent,
|
||||
user_agent: request.user_agent || "",
|
||||
}
|
||||
|
||||
# Required to unwrap exceptions that occur inside template rendering.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
def cache_store
|
||||
[:memory_store, { size: 64.megabytes }]
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
|
||||
Rails.configuration.to_prepare do
|
||||
GitHelper.init
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateE621ExportTables < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
reversible do |r|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddE621PoolsTagString < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column(:"e621.pools", :tag_string, :string, null: false, default: "")
|
||||
|
Loading…
Reference in New Issue
Block a user