snicco/trailing-slash-middleware

v1.9.0 2023-09-20 12:36 UTC

README

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

Installation

composer require snicco/trailing-slash-middleware

Usage

This middleware should be added globally or in a middleware group.

By default, this middleware will redirect requests with a trailing slash in the URL path to the same path without the trailing slash, ie: /foo/ => '/foo

If the opposite behaviour is desired you can pass (bool) false to the constructor.

$configurator->get('route1', '/route1', SomeController::class)
             ->middleware(Snicco\Middleware\TrailingSlash\TrailingSlash::class);

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.