Sha256: 34ad9883452c4e885a9c1c663e53c5838f42bd2cc8509fc34f15e9159b1a8a7e

Contents?: true

Size: 825 Bytes

Versions: 15

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

class Jets::ApplicationController < Jets::Controller::Base # :nodoc:
  prepend_view_path File.expand_path("../../../app/views", __dir__)
  layout "application"

  before_action :disable_content_security_policy_nonce!

  content_security_policy do |policy|
    policy.script_src :self, :unsafe_inline
    policy.style_src :self, :unsafe_inline
  end

  private
    def require_local!
      unless local_request?
        render html: "<p>For security purposes, this information is only available to local requests.</p>".html_safe, status: :forbidden
      end
    end

    def local_request?
      Jets.application.config.consider_all_requests_local || request.local?
    end

    def disable_content_security_policy_nonce!
      request.content_security_policy_nonce_generator = nil
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.12 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.11 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.10 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.9 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.8 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.7 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.6 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.5 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.4 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.3 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.2 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.1 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.0 engines/internal/app/controllers/jets/application_controller.rb
jets-5.0.0.beta1 engines/internal/app/controllers/jets/application_controller.rb