go-martini / martini

Classy web framework for Go
martini.codegangsta.io
MIT License
11.63k stars 1.1k forks source link

Added regexp capabilities for martini.Static Exclude option #410

Closed GabrielAlacchi closed 7 years ago

GabrielAlacchi commented 7 years ago

I wanted the ability to exclude files by extension as well as multiple directories in one of my projects. So I implemented the Exclude option so that if it detects any regexp special characters it will use a regular expression to match the URI to exclude. Otherwise the feature maintains its original behaviour, and simply checks if the URI contains the Exclude string as a prefix. I also wrote an additional unit test in static_test.go for this option.