View | Details | Raw Unified | Return to bug 39245
Collapse All | Expand All

(-)modules/proxy/mod_proxy_http.c (-2 / +2 lines)
Lines 1448-1454 Link Here
1448
             * if we are overriding the errors, we can't put the content
1448
             * if we are overriding the errors, we can't put the content
1449
             * of the page into the brigade
1449
             * of the page into the brigade
1450
             */
1450
             */
1451
            if (!conf->error_override || ap_is_HTTP_SUCCESS(r->status)) {
1451
            if ((r->status < conf->error_override) || ap_is_HTTP_SUCCESS(r->status)) {
1452
                /* read the body, pass it to the output filters */
1452
                /* read the body, pass it to the output filters */
1453
                apr_read_type_e mode = APR_NONBLOCK_READ;
1453
                apr_read_type_e mode = APR_NONBLOCK_READ;
1454
                int finish = FALSE;
1454
                int finish = FALSE;
Lines 1557-1563 Link Here
1557
1557
1558
    if (conf->error_override) {
1558
    if (conf->error_override) {
1559
        /* the code above this checks for 'OK' which is what the hook expects */
1559
        /* the code above this checks for 'OK' which is what the hook expects */
1560
        if (ap_is_HTTP_SUCCESS(r->status))
1560
        if ((r->status < conf->error_override) | ap_is_HTTP_SUCCESS(r->status))
1561
            return OK;
1561
            return OK;
1562
        else {
1562
        else {
1563
            /* clear r->status for override error, otherwise ErrorDocument
1563
            /* clear r->status for override error, otherwise ErrorDocument
(-)modules/proxy/mod_proxy.c (-4 / +22 lines)
Lines 1394-1406 Link Here
1394
}
1394
}
1395
1395
1396
static const char *
1396
static const char *
1397
    set_proxy_error_override(cmd_parms *parms, void *dummy, int flag)
1397
    set_proxy_error_override(cmd_parms *parms, void *dummy, const char *arg)
1398
{
1398
{
1399
    proxy_server_conf *psf =
1399
    proxy_server_conf *psf =
1400
    ap_get_module_config(parms->server->module_config, &proxy_module);
1400
    ap_get_module_config(parms->server->module_config, &proxy_module);
1401
    int min_override;
1402
    char *endptr;
1401
1403
1402
    psf->error_override = flag;
1404
    if (strncasecmp(arg, "OFF", 3) == 0) {
1405
        min_override = 0;
1406
    }
1407
1408
    else if(strncasecmp(arg, "ON", 2) == 0) { 
1409
        min_override = 300;
1410
    }
1411
1412
    else { 
1413
        min_override = strtol(arg, &endptr, 10);
1414
        if (*endptr != '\0' || !ap_is_HTTP_VALID_RESPONSE(min_override)) { 
1415
            return "ProxyErrorOverride: argument must be ON, OFF, or an HTTP status code";
1416
        }
1417
    }
1418
       
1419
    psf->error_override = min_override;
1403
    psf->error_override_set = 1;
1420
    psf->error_override_set = 1;
1421
1404
    return NULL;
1422
    return NULL;
1405
}
1423
}
1406
static const char *
1424
static const char *
Lines 1892-1899 Link Here
1892
     "A list of ports which CONNECT may connect to"),
1910
     "A list of ports which CONNECT may connect to"),
1893
    AP_INIT_TAKE1("ProxyVia", set_via_opt, NULL, RSRC_CONF,
1911
    AP_INIT_TAKE1("ProxyVia", set_via_opt, NULL, RSRC_CONF,
1894
     "Configure Via: proxy header header to one of: on | off | block | full"),
1912
     "Configure Via: proxy header header to one of: on | off | block | full"),
1895
    AP_INIT_FLAG("ProxyErrorOverride", set_proxy_error_override, NULL, RSRC_CONF,
1913
    AP_INIT_TAKE1("ProxyErrorOverride", set_proxy_error_override, NULL, RSRC_CONF,
1896
     "use our error handling pages instead of the servers' we are proxying"),
1914
     "Use our error handling pages instead of the servers' we are proxying: off | on | minimum-error-code-to-override"),
1897
    AP_INIT_FLAG("ProxyPreserveHost", set_preserve_host, NULL, RSRC_CONF,
1915
    AP_INIT_FLAG("ProxyPreserveHost", set_preserve_host, NULL, RSRC_CONF,
1898
     "on if we should preserve host header while proxying"),
1916
     "on if we should preserve host header while proxying"),
1899
    AP_INIT_TAKE1("ProxyTimeout", set_proxy_timeout, NULL, RSRC_CONF,
1917
    AP_INIT_TAKE1("ProxyTimeout", set_proxy_timeout, NULL, RSRC_CONF,

Return to bug 39245