Skip to content

Not compatible with Rails 5.2 CSP #28

@pradeepkumar-powerschool

Description

Issue
When trying to implement CSP(content security policy) in Rails 5.2 Trix editor breaks. can anyone help here with how to fix it?

Code added in application.rb

      config.content_security_policy do |policy|
        policy.default_src :self, :https
        policy.font_src    :self, :https, :data
        policy.img_src     :self, :https, :data
        policy.object_src  :none
        policy.script_src  :self, :https
        policy.style_src   :self, :https
      end

rendered editor:-
Screenshot 2024-01-12 at 6 48 32 PM

Environment (please complete the following information):

  • Rails version: 5.2.4
  • trix-rails version: 2.3.0
  • Browser:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions