Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added WithoutPan middleware #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrispage1
Copy link

Hey Nuno, amazing package as ever so thank you!

However... For some routes, it might be that you don't want to have Pan inject its code.

An example of this - I was creating a web page that generates an HTML mailer and that source code is pulled in by Campaign Monitor. Campaign Monitor began rejecting our emails because we were now trying to inject JavaScript.

Usage:

Route::get('/testing', function() {
  return view('pages.no-pan');
})->middleware(Pan\Adapters\Laravel\Http\Middleware\WithoutPan::class);

This will prevent Pan from injecting its code on this specific route only.

Thanks!

@chrispage1
Copy link
Author

I've realised it wouldn't pass static analysis because $route->middleware() can return an array or Route. Tidied up to pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant