(rw http.ResponseWriter, req *http.Request)
| 612 | } |
| 613 | |
| 614 | func (ui *UIHandler) serveClosure(rw http.ResponseWriter, req *http.Request) { |
| 615 | suffix := httputil.PathSuffix(req) |
| 616 | if ui.closureHandler == nil { |
| 617 | log.Printf("%v not served: closure handler is nil", suffix) |
| 618 | http.NotFound(rw, req) |
| 619 | return |
| 620 | } |
| 621 | m := closurePattern.FindStringSubmatch(suffix) |
| 622 | if m == nil { |
| 623 | httputil.ErrorRouting(rw, req) |
| 624 | return |
| 625 | } |
| 626 | req.URL.Path = "/" + m[1] |
| 627 | ui.closureHandler.ServeHTTP(rw, req) |
| 628 | } |
| 629 | |
| 630 | // serveFromDiskOrStatic matches rx against req's path and serves the match either from disk (if non-nil) or from static (embedded in the binary). |
| 631 | func (ui *UIHandler) serveFromDiskOrStatic(rw http.ResponseWriter, req *http.Request, rx *regexp.Regexp, |
no test coverage detected