Changeset 6745:93121485c39b in nginx


Ignore:
Timestamp:
10/14/16 16:48:26 (3 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Message:

Upstream: hide_headers_hash handling at http level.

When headers to hide are set at the "http" level and not redefined in
a server block, we now preserve compiled headers hash into the "http"
section configuration to inherit this hash to all servers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/ngx_http_upstream.c

    r6744 r6745  
    61076107    hash->temp_pool = NULL;
    61086108
    6109     return ngx_hash_init(hash, hide_headers.elts, hide_headers.nelts);
     6109    if (ngx_hash_init(hash, hide_headers.elts, hide_headers.nelts) != NGX_OK) {
     6110        return NGX_ERROR;
     6111    }
     6112
     6113    /*
     6114     * special handling to preserve conf->hide_headers_hash
     6115     * in the "http" section to inherit it to all servers
     6116     */
     6117
     6118    if (prev->hide_headers_hash.buckets == NULL
     6119        && conf->hide_headers == prev->hide_headers
     6120        && conf->pass_headers == prev->pass_headers)
     6121    {
     6122        prev->hide_headers_hash = conf->hide_headers_hash;
     6123    }
     6124
     6125    return NGX_OK;
    61106126}
    61116127
Note: See TracChangeset for help on using the changeset viewer.