Ticket #559: ngx_http_auth_request_module.c.patch

File ngx_http_auth_request_module.c.patch, 784 bytes (added by David Coutadeur, 12 years ago)

patch

  • ngx_http_auth_request_module.c

    old new  
    138138            return ctx->status;
    139139        }
    140140
     141        /* case redirect */
     142        if (ctx->status == NGX_HTTP_MOVED_TEMPORARILY) {
     143            sr = ctx->subrequest;
     144            h = sr->headers_out.location;
     145            if (h) {
     146                ho = ngx_list_push(&r->headers_out.headers);
     147                if (ho == NULL) {
     148                    return NGX_ERROR;
     149                }
     150               
     151                *ho = *h;
     152                r->headers_out.location = ho;
     153            }
     154            return ctx->status;
     155        }
     156
    141157        if (ctx->status == NGX_HTTP_UNAUTHORIZED) {
    142158            sr = ctx->subrequest;