MCPcopy
hub / github.com/puma/puma-dev / shouldServePublicPathForApp

Method shouldServePublicPathForApp

dev/http.go:195–216  ·  view source on GitHub ↗
(a *App, req *http.Request)

Source from the content-addressed store, hash-verified

193}
194
195func (h *HTTPServer) shouldServePublicPathForApp(a *App, req *http.Request) bool {
196 reqPath := path.Clean(req.URL.Path)
197
198 if !a.Public {
199 return false
200 }
201
202 if reqPath == "/" {
203 return false
204 }
205
206 for _, ignoredPath := range h.IgnoredStaticPaths {
207 if strings.HasPrefix(reqPath, ignoredPath) {
208 if h.Debug {
209 fmt.Fprintf(os.Stdout, "Not serving '%s' as it matches a path in no-serve-public-paths\n", reqPath)
210 }
211 return false
212 }
213 }
214
215 return true
216}
217
218func (h *HTTPServer) status(w http.ResponseWriter, req *http.Request) {
219 type appStatus struct {

Callers 1

ServeHTTPMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected