Skip to content

Instantly share code, notes, and snippets.

View afloesch's full-sized avatar

Andrew Loesch afloesch

  • Bowers & Wilkins
  • Menlo Park, CA
View GitHub Profile
@ananth-iyer
ananth-iyer / CsrfValidatorSkip.php
Last active October 30, 2023 10:33
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
<?php
namespace Vendor\Module\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action
##
## HTTP Router benchmarks -- Nov 29, 2020 with Go 1.15.5 on Linux AMD 3950x
##
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
##
## *NOTE*: the memory reports below by the go benchmark tool look quite wrong, as there must
## be a bug somewhere in the go bench tool with the Go version I'm running. I will re-run
## with future versions and report back. However, in general you'll want to look at the "ns/op"