Skip to content

Commit 6d798db

Browse files
authored
📝 middleware/filesystem does not handle url encoded values on it's own (#2247)
* 📝 middleware/filesystem does not handle url encoded values * Update README.md add newline after first warning Co-authored-by: Xaver Fischer <[email protected]>
1 parent 3629947 commit 6d798db

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

middleware/filesystem/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

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

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

78
## Table of Contents
89

middleware/filesystem/filesystem.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ var ConfigDefault = Config{
6464
MaxAge: 0,
6565
}
6666

67-
// New creates a new middleware handler
67+
// New creates a new middleware handler.
68+
//
69+
// filesystem does not handle url encoded values (for example spaces)
70+
// on it's own. If you need that functionality, set "UnescapePath"
71+
// in fiber.Config
6872
func New(config ...Config) fiber.Handler {
6973
// Set default config
7074
cfg := ConfigDefault

0 commit comments

Comments
 (0)