Class: Quilt::HeaderCsrfStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/quilt_rails/header_csrf_strategy.rb

Defined Under Namespace

Classes: NoSameSiteHeaderError

Constant Summary collapse

HEADER =
"x-shopify-react-xhr"
HEADER_VALUE =
"1"

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ HeaderCsrfStrategy

Returns a new instance of HeaderCsrfStrategy.



8
9
10
# File 'lib/quilt_rails/header_csrf_strategy.rb', line 8

def initialize(controller)
  @controller = controller
end

Instance Method Details

#handle_unverified_requestObject



12
13
14
# File 'lib/quilt_rails/header_csrf_strategy.rb', line 12

def handle_unverified_request
  raise NoSameSiteHeaderError unless same_site?
end