Skip to content

Commit

Permalink
📝 middleware/filesystem does not handle url encoded values on it's own (
Browse files Browse the repository at this point in the history
#2247)

* 📝 middleware/filesystem does not handle url encoded values

* Update README.md

add newline after first warning

Co-authored-by: Xaver Fischer <xaverfischer@mail.de>
  • Loading branch information
Simerax and Simerax committed Dec 1, 2022
1 parent 3629947 commit 6d798db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion middleware/filesystem/README.md
Expand Up @@ -2,7 +2,8 @@

Filesystem middleware for [Fiber](https://github.com/gofiber/fiber) that enables you to serve files from a directory.

⚠️ **`:params` & `:optionals?` within the prefix path are not supported!**
⚠️ **`:params` & `:optionals?` within the prefix path are not supported!**
⚠️ **To handle paths with spaces (or other url encoded values) make sure to set `fiber.Config{ UnescapePath: true}`**

## Table of Contents

Expand Down
6 changes: 5 additions & 1 deletion middleware/filesystem/filesystem.go
Expand Up @@ -64,7 +64,11 @@ var ConfigDefault = Config{
MaxAge: 0,
}

// New creates a new middleware handler
// New creates a new middleware handler.
//
// filesystem does not handle url encoded values (for example spaces)
// on it's own. If you need that functionality, set "UnescapePath"
// in fiber.Config
func New(config ...Config) fiber.Handler {
// Set default config
cfg := ConfigDefault
Expand Down

0 comments on commit 6d798db

Please sign in to comment.