mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-19 02:28:48 +08:00
Clarifying comment since it's subtle that an err is returned
This commit is contained in:
parent
1c0f014fb5
commit
b876f2b772
@ -430,9 +430,13 @@ func (m MatchFile) selectFile(r *http.Request) (bool, error) {
|
||||
switch m.TryPolicy {
|
||||
case "", tryPolicyFirstExist:
|
||||
for _, pattern := range m.TryFiles {
|
||||
// If the pattern is a status code, emit an error,
|
||||
// which short-circuits the middleware pipeline and
|
||||
// writes an HTTP error response.
|
||||
if err := parseErrorCode(pattern); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
candidates := makeCandidates(pattern)
|
||||
for _, c := range candidates {
|
||||
if info, exists := m.strictFileExists(fileSystem, c.fullpath); exists {
|
||||
|
Loading…
x
Reference in New Issue
Block a user