[ARVADOS] updated: 1.3.0-2404-g8d7a94c67

Git user git at public.arvados.org
Wed Apr 1 17:43:08 UTC 2020


Summary of changes:
 lib/service/cmd_test.go     |  1 +
 sdk/go/httpserver/logger.go | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

       via  8d7a94c6799f20028725c1cc00614f1f7ae01209 (commit)
       via  72f0641da38b49a13fefe1a62faa6cf74c6ebe03 (commit)
      from  e54ef05f9e10b28ea105d4e82a09ee05e00857ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 8d7a94c6799f20028725c1cc00614f1f7ae01209
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed Apr 1 13:42:43 2020 -0400

    16217: Restore http.Hijacker capability to wrapped ResponseWriter.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/sdk/go/httpserver/logger.go b/sdk/go/httpserver/logger.go
index 8886f9517..59981e3e5 100644
--- a/sdk/go/httpserver/logger.go
+++ b/sdk/go/httpserver/logger.go
@@ -53,10 +53,22 @@ func LogRequests(h http.Handler) http.Handler {
 
 		logRequest(w, req, lgr)
 		defer logResponse(w, req, lgr)
-		h.ServeHTTP(w, req)
+		h.ServeHTTP(rewrapResponseWriter(w, wrapped), req)
 	})
 }
 
+// Rewrap w to restore additional interfaces provided by wrapped.
+func rewrapResponseWriter(w http.ResponseWriter, wrapped http.ResponseWriter) http.ResponseWriter {
+	if hijacker, ok := wrapped.(http.Hijacker); ok {
+		return struct {
+			http.ResponseWriter
+			http.Hijacker
+		}{w, hijacker}
+	} else {
+		return w
+	}
+}
+
 func Logger(req *http.Request) logrus.FieldLogger {
 	return ctxlog.FromContext(req.Context())
 }

commit 72f0641da38b49a13fefe1a62faa6cf74c6ebe03
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed Apr 1 13:42:08 2020 -0400

    16217: Fix test (satisfy additional handler interface).
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/service/cmd_test.go b/lib/service/cmd_test.go
index 86039c4dd..ec7834972 100644
--- a/lib/service/cmd_test.go
+++ b/lib/service/cmd_test.go
@@ -135,6 +135,7 @@ type testHandler struct {
 	healthCheck chan bool
 }
 
+func (th *testHandler) Done() <-chan struct{}                            { return nil }
 func (th *testHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { th.handler.ServeHTTP(w, r) }
 func (th *testHandler) CheckHealth() error {
 	ctxlog.FromContext(th.ctx).Info("CheckHealth called")

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list