You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When presented without a formatter a Grape::Entity gets serialized with all its internals, including @options. This doesn't appear to leak any sensitive information most of the time, but YMMV as the rack app, session, request objects and ActiveRecord internals come along.
It's a nasty side effect of adding something like content_type :csv, 'text/csv' and not having a general formatter :csv, ... that catches everything and calls, for example, to_csv. Entities by default support to_xml and to_json, but nothing else.
When presented without a formatter a Grape::Entity gets serialized with all its internals, including
@options
. This doesn't appear to leak any sensitive information most of the time, but YMMV as the rack app, session, request objects and ActiveRecord internals come along.It's a nasty side effect of adding something like
content_type :csv, 'text/csv'
and not having a generalformatter :csv, ...
that catches everything and calls, for example,to_csv
. Entities by default supportto_xml
andto_json
, but nothing else.Complete example in https://gist.github.com/dblock/5b49741468efd5b6a7d6828167d47a65.
The text was updated successfully, but these errors were encountered: