Fix preflight response status in access logs

Co-authored-by: lbenguigui <lbenguigui@gmail.com>
This commit is contained in:
Romain 2023-09-29 12:18:06 +02:00 committed by GitHub
parent ab7993428d
commit e95fde5652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 0 deletions

View file

@ -53,6 +53,7 @@ func NewHeader(next http.Handler, cfg dynamic.Headers) (*Header, error) {
func (s *Header) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
// Handle Cors headers and preflight if configured.
if isPreflight := s.processCorsHeaders(rw, req); isPreflight {
rw.WriteHeader(http.StatusOK)
return
}