Match returns true if r matches m. Returns true if a file was matched. If so, four placeholders will be available: - http.matchers.file.relative: Path to file relative to site root - http.matchers.file.absolute: Path to file including site root - http.matchers.file.type: file or directory - http.mat
(r *http.Request)
| 315 | // - http.matchers.file.type: file or directory |
| 316 | // - http.matchers.file.remainder: Portion remaining after splitting file path (if configured) |
| 317 | func (m MatchFile) Match(r *http.Request) bool { |
| 318 | match, err := m.selectFile(r) |
| 319 | if err != nil { |
| 320 | // nolint:staticcheck |
| 321 | caddyhttp.SetVar(r.Context(), caddyhttp.MatcherErrorVarKey, err) |
| 322 | } |
| 323 | return match |
| 324 | } |
| 325 | |
| 326 | // MatchWithError returns true if r matches m. |
| 327 | func (m MatchFile) MatchWithError(r *http.Request) (bool, error) { |
nothing calls this directly
no test coverage detected