Closed garrettd714 closed 2 years ago
I use Sidekiq along with the Sidekiq web UI. The web UI was failing to load after implementing versioncake.
FrozenError (can't modify frozen String) versioncake (4.0.2) lib/versioncake/response_strategy/http_content_type_strategy.rb:7:in 'execute'
To fix this, I added this code to the bottom (after the setup block) of the versioncake initializer
VersionCake::ResponseStrategy::HttpContentTypeStrategy.class_eval do def execute(context, _status, headers, _response) return if headers['Content-Type'].nil? || headers['Content-Type'].frozen? headers['Content-Type'] << ';' unless headers['Content-Type'].end_with? ';' headers['Content-Type'] << " #{version_key}=#{context.version.to_s}" end end
Hope this helps anyone who runs into the same issue.
Thank you for the fix, we were stuck on this for a while!
I use Sidekiq along with the Sidekiq web UI. The web UI was failing to load after implementing versioncake.
FrozenError (can't modify frozen String) versioncake (4.0.2) lib/versioncake/response_strategy/http_content_type_strategy.rb:7:in 'execute'
To fix this, I added this code to the bottom (after the setup block) of the versioncake initializer
Hope this helps anyone who runs into the same issue.