(reqPath, allowedPath string)
| 723 | } |
| 724 | |
| 725 | func adminPathAllowed(reqPath, allowedPath string) bool { |
| 726 | if allowedPath == "" || allowedPath == "/" { |
| 727 | return strings.HasPrefix(reqPath, allowedPath) |
| 728 | } |
| 729 | if reqPath == allowedPath { |
| 730 | return true |
| 731 | } |
| 732 | if strings.HasSuffix(allowedPath, "/") { |
| 733 | return strings.HasPrefix(reqPath, allowedPath) |
| 734 | } |
| 735 | return strings.HasPrefix(reqPath, allowedPath+"/") |
| 736 | } |
| 737 | |
| 738 | func stopAdminServer(srv *http.Server) error { |
| 739 | if srv == nil { |
no outgoing calls
no test coverage detected