Ticket #285: satisfy_any_unauth_forbidden.patch

File satisfy_any_unauth_forbidden.patch, 597 bytes (added by Jan Marc Hoffmann, 14 years ago)
  • src/http/ngx_http_core_module.c

    old new  
    11411141        }
    11421142
    11431143        if (rc == NGX_HTTP_FORBIDDEN || rc == NGX_HTTP_UNAUTHORIZED) {
    1144             r->access_code = rc;
     1144           
     1145            /* do not overwrite unauth with forbidden when satisfy any is set */
     1146            if (clcf->satisfy == NGX_HTTP_SATISFY_ALL || r->access_code != NGX_HTTP_UNAUTHORIZED) {
     1147                r->access_code = rc;
     1148            }                                                   
    11451149
    11461150            r->phase_handler++;
    11471151            return NGX_AGAIN;