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>

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.