0

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>
Hons
  • 3,804
  • 3
  • 32
  • 50

1 Answers1

1

Is there something like the traceEnable parameter in apache, in golang net/http?

No.

You have to do that in your handler or middleware.

Volker
  • 40,468
  • 7
  • 81
  • 87