1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-03-17 21:18:19 +02:00

Merge branch 'release/v1.6.5'

This commit is contained in:
Ralph Slooten 2023-04-25 08:58:22 +12:00
commit e843de6166
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,12 @@
Notable changes to Mailpit will be documented in this file.
## [v1.6.5]
### Feature
- Add Access-Control-Allow-Methods methods when CORS origin is set
## [v1.6.4]
### Bugfix

View File

@ -122,6 +122,7 @@ func middleWareFunc(fn http.HandlerFunc) http.HandlerFunc {
if AccessControlAllowOrigin != "" && strings.HasPrefix(r.RequestURI, config.Webroot+"api/") {
w.Header().Set("Access-Control-Allow-Origin", AccessControlAllowOrigin)
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")
}
if config.UIAuthFile != "" {
@ -159,6 +160,7 @@ func middlewareHandler(h http.Handler) http.Handler {
if AccessControlAllowOrigin != "" && strings.HasPrefix(r.RequestURI, config.Webroot+"api/") {
w.Header().Set("Access-Control-Allow-Origin", AccessControlAllowOrigin)
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")
}
if config.UIAuthFile != "" {