mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 02:21:42 +00:00
solo descargar los sourcemaps remotos a través de conexiones seguras
This commit is contained in:
parent
f356793908
commit
5f87540de7
1 changed files with 4 additions and 2 deletions
|
@ -28,7 +28,7 @@ class BacktraceJob < ApplicationJob
|
|||
|
||||
# Encuentra el código fuente del error
|
||||
source = data.dig('sourcesContent', data['sources']&.index(backtrace['file']))&.split("\n")
|
||||
backtrace['function'] = source.dig(backtrace['line'] - 1) if source.present?
|
||||
backtrace['function'] = source[backtrace['line'] - 1] if source.present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -67,6 +67,8 @@ class BacktraceJob < ApplicationJob
|
|||
# @param [String] La URL del map
|
||||
# @return [Hash]
|
||||
def data(map)
|
||||
return {} unless map.start_with? 'https://'
|
||||
|
||||
map += '.map' unless map.end_with? '.map'
|
||||
|
||||
@data ||= {}
|
||||
|
@ -85,7 +87,7 @@ class BacktraceJob < ApplicationJob
|
|||
def sourcemap
|
||||
@sourcemap ||=
|
||||
begin
|
||||
sources.map { |x| "#{x}.map" }.map do |map|
|
||||
sources.map do |map|
|
||||
SourceMap::Map.from_hash data(map)
|
||||
rescue Down::Error, FastJsonparser::Error
|
||||
SourceMap::Map.new
|
||||
|
|
Loading…
Reference in a new issue