From 2ab2f2d762331bcf664e7e7c39b60b6517895e74 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 26 Mar 2017 13:02:22 -0700 Subject: [PATCH] server: director --- server/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index d1becfd..a92683d 100644 --- a/server/server.go +++ b/server/server.go @@ -160,6 +160,10 @@ func (s *Server) onionPath(name string) string { return filepath.Join(s.cfg.TorDataDir, name) } +func (s *Server) Director(r *http.Request) { + +} + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { r.Header.Del("X-Forwarded-For") @@ -185,7 +189,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Header().Set("X-Clacks-Overhead", "GNU Ashlynn") if strings.HasSuffix(r.Host, ".onion") { - w.Header().Add("DNT", "1") + r.Header.Add("DNT", "1") } if r.RequestURI == rpc.DefaultRPCPath { @@ -194,6 +198,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { } rp := &httputil.ReverseProxy{ + Director: s.Director, Transport: s.ts, FlushInterval: 1 * time.Second, }