Skip to content

Commit

Permalink
Merge branch 'release/v1.6.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Apr 24, 2023
2 parents dfb455c + b6f2618 commit e843de6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down Expand Up @@ -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 != "" {
Expand Down

0 comments on commit e843de6

Please sign in to comment.