Skip to content

Conversation

@DropsOfSerenity
Copy link
Contributor

Frozen strings cannot have #insert called on them, this was causing an error on the requests page. This PR fixes that issue.

Fixes #611

Frozen strings cannot have `#insert` called on them, this was causing an
error on the requests page.
@coalest
Copy link
Collaborator

coalest commented Feb 10, 2025

It looks iike the blank_page_html is the only place we are creating a frozen string (the other strings have string interpolations so they aren't frozen despite the frozen string literal comment), so potentially we could just add a dup to that method instead of calling dup on every fragment?

@DropsOfSerenity
Copy link
Contributor Author

It looks iike the blank_page_html is the only place we are creating a frozen string (the other strings have string interpolations so they aren't frozen despite the frozen string literal comment), so potentially we could just add a dup to that method instead of calling dup on every fragment?

Excellent, that sounds good to me, been a bit busy, but I should be able to make the edit soon.


expect(last_response.body).to include('<title>Rack::MiniProfiler Requests</title>')
expect(last_response.body).to match('<body>\n </body>')
expect(last_response.body).to match('<body>\n <script async nonce="" type="text/javascript" id="mini-profiler"')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. Without the .dup, it looks like we were not inserting the rmp script?

@nateberkopec nateberkopec merged commit 470c9a8 into MiniProfiler:master Apr 13, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MiniProfiler storage failure: can't modify frozen

3 participants