Is there something like the traceEnable
parameter in apache, in golang net/http?
I do have something like the following, but I do want to listen to GET
, POST
and HEAD
, however not to the TRACE
method
go func() {
logger.Log(
"level", 1,
"action", "start https",
"addr", opts.httpsAddr,
)
s := &http.Server{
Addr: opts.httpsAddr,
Handler: server,
TLSConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
},
}
http2.ConfigureServer(s, nil)
fatal("failed to start HTTPS: %s", s.ListenAndServeTLS(opts.tlsCrt, opts.tlsKey))
}()
Basically I'd like to return a 405 on such a request
curl -v -X TRACE https://<server>
Is there something like the traceEnable parameter in apache, in golang net/http?
No.
You have to do that in your handler or middleware.