Skip to content

Commit 40aaa97

Browse files
committed
Pass all OPTIONS requests to the underlying handler.
1 parent f1b3653 commit 40aaa97

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎config.go‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,16 @@ func (singleton) apply(options ...option) option {
122122
this.Context, this.ContextShutdown = context.WithCancel(this.Context)
123123
if this.HTTPServer == nil {
124124
this.HTTPServer = &http.Server{
125-
Addr: this.ListenAddress,
126-
Handler: this.Handler,
127-
MaxHeaderBytes: this.MaxRequestHeaderSize,
128-
ReadTimeout: this.ReadRequestTimeout,
129-
ReadHeaderTimeout: this.ReadRequestHeaderTimeout,
130-
WriteTimeout: this.WriteResponseTimeout,
131-
IdleTimeout: this.IdleConnectionTimeout,
132-
BaseContext: func(net.Listener) context.Context { return this.Context },
133-
ErrorLog: newServerLogger(this.ErrorLogger),
125+
Addr: this.ListenAddress,
126+
Handler: this.Handler,
127+
DisableGeneralOptionsHandler: true,
128+
MaxHeaderBytes: this.MaxRequestHeaderSize,
129+
ReadTimeout: this.ReadRequestTimeout,
130+
ReadHeaderTimeout: this.ReadRequestHeaderTimeout,
131+
WriteTimeout: this.WriteResponseTimeout,
132+
IdleTimeout: this.IdleConnectionTimeout,
133+
BaseContext: func(net.Listener) context.Context { return this.Context },
134+
ErrorLog: newServerLogger(this.ErrorLogger),
134135
}
135136
}
136137
}

0 commit comments

Comments
 (0)