mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
SECURITY: prefer render plain/html to render text where possible
This commit is contained in:
@ -14,7 +14,7 @@ class Admin::DiagnosticsController < Admin::AdminController
|
||||
|
||||
text << "\n\nCOUNT #{statements.count}"
|
||||
|
||||
render text: text, content_type: Mime::TEXT
|
||||
render plain: text
|
||||
end
|
||||
|
||||
def memory_stats
|
||||
@ -33,7 +33,7 @@ class Admin::DiagnosticsController < Admin::AdminController
|
||||
text = MemoryDiagnostics.memory_report(class_report: params.key?(:full))
|
||||
end
|
||||
|
||||
render text: text, content_type: Mime::TEXT
|
||||
render plain: text
|
||||
end
|
||||
|
||||
def dump_heap
|
||||
@ -46,9 +46,9 @@ class Admin::DiagnosticsController < Admin::AdminController
|
||||
ObjectSpace.dump_all(:output => io)
|
||||
io.close
|
||||
|
||||
render text: "HEAP DUMP:\n#{io.path}", content_type: Mime::TEXT
|
||||
render plain: "HEAP DUMP:\n#{io.path}"
|
||||
rescue
|
||||
render text: "HEAP DUMP:\nnot supported", content_type: Mime::TEXT
|
||||
render plain: "HEAP DUMP:\nnot supported"
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user