add cors middleware

This commit is contained in:
yanghao05
2023-01-30 11:44:34 +08:00
parent 3ab579fed7
commit 16f80cc297
4 changed files with 105 additions and 1 deletions

View File

@@ -9,6 +9,18 @@ type Http struct {
Https bool
HttpsCert string
HttpKey string
Cors struct {
Mode string
Whitelist []Whitelist
}
}
type Whitelist struct {
AllowOrigin string
AllowHeaders string
AllowMethods string
ExposeHeaders string
AllowCredentials bool
}
func (h Http) Address() string {