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

🚀 [Feature]: filesystem.Config add file encoding property support #2434

Closed
3 tasks done
baichangda opened this issue Apr 26, 2023 · 1 comment · Fixed by #2438
Closed
3 tasks done

🚀 [Feature]: filesystem.Config add file encoding property support #2434

baichangda opened this issue Apr 26, 2023 · 1 comment · Fixed by #2438

Comments

@baichangda
Copy link
Contributor

baichangda commented Apr 26, 2023

Feature Description

now use filesystem like this、the response header content-type of the file has no charset、hope add property in filesystem.Config for response header content-type charset
image

Additional Context (optional)

No response

Code Snippet (optional)

package main

import "github.com/gofiber/fiber/v2"
import "github.com/gofiber/fiber/v2/middleware/filesystem"
import "log"
//go:embed resource/*
var FS embed.FS
func main() {
app.Use("/", filesystem.New(filesystem.Config{
		Root:       http.FS(FS),
		PathPrefix: "resource",
		Browse:     true,
                 ContentTypeCharset: "utf-8",
	}))
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.
@welcome
Copy link

welcome bot commented Apr 26, 2023

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant