• Tobias Weingartner's avatar
    Fixup mime middleware to use a map and error on duplicate extensions. · b471b7e8
    Tobias Weingartner authored
     - The mime middleware used filepath where it should arguably use path.
     - Changed the configuration to use a map instead of scanning an array
       during every request.  The map is static (after configuration), so
       should be fine for concurrent access.
     - Catch duplicate extensions within a configuration and error out.
     - Add tests for new error case.
    b471b7e8
mime_test.go 1.39 KB