Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 middleware/filesystem does not handle url encoded values on it's own #2247

Merged
merged 2 commits into from Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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