Sha256: ca068cd53cfd5a38a732c253c0a1977d546c5c7b968e7eaaeb65b5a8fb976f4f
Contents?: true
Size: 554 Bytes
Versions: 27
Compression:
Stored size: 554 Bytes
Contents
# frozen_string_literal: true module Quilt class TrustedUiServerCsrfStrategy def initialize(controller) @controller = controller end def handle_unverified_request return if node_server_side_render? fallback_handler.handle_unverified_request end private def node_server_side_render? @controller.request.headers['x-shopify-server-side-rendered'] == '1' end def fallback_handler ActionController::RequestForgeryProtection::ProtectionMethods::Exception.new(@controller) end end end
Version data entries
27 entries across 27 versions & 1 rubygems