mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 13:56:22 +00:00
un poco más robusto
This commit is contained in:
parent
695f12ad0f
commit
893d79f7fd
2 changed files with 3 additions and 2 deletions
|
@ -28,10 +28,11 @@ module Api
|
|||
|
||||
def site
|
||||
@site ||= Site.find(params[:site_id])
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
def verify_api_key
|
||||
site.verifier.verify(airbrake_token, purpose: :airbrake) === Site::Api::AIRBRAKE_SECRET
|
||||
site&.verifier&.verify(airbrake_token, purpose: :airbrake) === Site::Api::AIRBRAKE_SECRET
|
||||
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
||||
false
|
||||
end
|
||||
|
|
|
@ -40,7 +40,7 @@ class BacktraceJob < ApplicationJob
|
|||
|
||||
# Obtiene todos los archivos del backtrace
|
||||
def files
|
||||
@files ||= params['errors'].map { |x| x['backtrace'] }.flatten.map { |x| x['file'].split('@').last }.uniq.select { |x| x.start_with? site.url }
|
||||
@files ||= params['errors'].map { |x| x['backtrace'] }.flatten.map { |x| x['file'].split('@').last }.uniq.select { |x| x&.start_with?(site.url) }
|
||||
end
|
||||
|
||||
# Asume que todos los sourcemaps comparten la misma URL, lo
|
||||
|
|
Loading…
Reference in a new issue