Clarifying comment since it's subtle that an err is returned

This commit is contained in:
Francis Lavoie 2024-10-11 19:55:50 -04:00
parent 1c0f014fb5
commit b876f2b772

View File

@ -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 {