MiniProfiler / rack-mini-profiler

Profiler for your development and production Ruby rack apps.
MIT License
3.68k stars 400 forks source link

Fixed the storage error when html is frozen #606

Open haseebeqx opened 5 months ago

haseebeqx commented 5 months ago

I was getting this error in my logs when I was trying to load /rack-mini-profiler/requests.

MiniProfiler storage failure: can't modify frozen String: "<!DOCTYPE html>\n\n \n Rack::MiniProfiler Requests\n \n \n \n\n"

This PR fixes the issue by using string + method. It will use the original string if it is not frozen and create a duplicated string if it is frozen.

SamSaffron commented 4 months ago

body is usually an array, insert should work can you create a test case for this?

haseebeqx commented 4 months ago

@SamSaffron Thanks. I will check that.