1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
15 func cloneTLSConfig(c *tls.Config) *tls.Config {
17 c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264
21 var _ http.Pusher = (*responseWriter)(nil)
23 // Push implements http.Pusher.
24 func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
25 internalOpts := pushOptions{}
27 internalOpts.Method = opts.Method
28 internalOpts.Header = opts.Header
30 return w.push(target, internalOpts)
33 func configureServer18(h1 *http.Server, h2 *Server) error {
34 if h2.IdleTimeout == 0 {
35 if h1.IdleTimeout != 0 {
36 h2.IdleTimeout = h1.IdleTimeout
38 h2.IdleTimeout = h1.ReadTimeout
44 func shouldLogPanic(panicValue interface{}) bool {
45 return panicValue != nil && panicValue != http.ErrAbortHandler
48 func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
52 func reqBodyIsNoBody(body io.ReadCloser) bool {
53 return body == http.NoBody
56 func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only