File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ func main() {
100100 log .Fatal ("failed to create a standard logger for the reverse proxy" , zap .Error (err ))
101101 }
102102
103- mux . Handle ( "/v2/" , & httputil.ReverseProxy {
103+ reverseProxy := & httputil.ReverseProxy {
104104 Director : func (req * http.Request ) {
105105 if err := addAuthToken (req ); err != nil {
106106 log .Error ("failed to add auth token to request" , zap .Error (err ))
@@ -115,6 +115,12 @@ func main() {
115115
116116 http .Error (w , "upstream failure" , http .StatusBadGateway )
117117 },
118+ }
119+
120+ mux .HandleFunc ("/v2/" , func (w http.ResponseWriter , req * http.Request ) {
121+ log .Debug ("proxying request" , zap .String ("url" , req .RequestURI ))
122+
123+ reverseProxy .ServeHTTP (w , req )
118124 })
119125
120126 mux .HandleFunc ("/health" , func (w http.ResponseWriter , req * http.Request ) {
You can’t perform that action at this time.
0 commit comments