5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-27 07:26:08 +00:00

fix: especificar qué parametros de airbrake permitimos #14956

(cherry picked from commit c22276f74f)
This commit is contained in:
f 2024-01-11 18:13:52 -03:00 committed by Sutty
parent d4c23e3406
commit cf1df71d40

View file

@ -23,7 +23,39 @@ module Api
# XXX: Por alguna razón Airbrake envía los datos con Content-Type:
# text/plain.
def airbrake_params
@airbrake_params ||= params.merge!(FastJsonparser.parse(request.raw_post) || {}).permit!
@airbrake_params ||=
params.merge!(FastJsonparser.parse(request.raw_post) || {})
.permit(
{
errors: [
:type,
:message,
{ backtrace: %i[file line column function] }
]
},
{
context: [
:url,
:language,
:severity,
:userAgent,
:windowError,
:rootDirectory,
{
history: [
:date,
:type,
:severity,
:target,
:method,
:duration,
:statusCode,
{ arguments: [] }
]
}
]
}
)
end
def site