test correction and Proxy func addition
This commit is contained in:
@@ -141,6 +141,15 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
panic("mux: method ServeHTTP called on nil")
|
||||
}
|
||||
|
||||
r.mux.ServeHTTP(w, req)
|
||||
}
|
||||
|
||||
// Proxy are request and
|
||||
func (r *Router) Proxy(w http.ResponseWriter, req *http.Request) {
|
||||
if r == nil {
|
||||
panic("mux: method ServeHTTP called on nil")
|
||||
}
|
||||
|
||||
h, pattern := r.mux.Handler(req)
|
||||
if pattern == "" {
|
||||
http.Error(w, "Not Found", http.StatusNotFound)
|
||||
|
Reference in New Issue
Block a user