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

(-)modules/http/http_filters.c (-3 / +21 lines)
Lines 1244-1249 Link Here
1244
    ap_bucket_error *eb = NULL;
1244
    ap_bucket_error *eb = NULL;
1245
    apr_status_t rv = APR_SUCCESS;
1245
    apr_status_t rv = APR_SUCCESS;
1246
    int recursive_error = 0;
1246
    int recursive_error = 0;
1247
    const char *hstripped_not_modified = NULL;
1247
1248
1248
    AP_DEBUG_ASSERT(!r->main);
1249
    AP_DEBUG_ASSERT(!r->main);
1249
1250
Lines 1427-1433 Link Here
1427
    h.bb = b2;
1428
    h.bb = b2;
1428
1429
1429
    if (r->status == HTTP_NOT_MODIFIED) {
1430
    if (r->status == HTTP_NOT_MODIFIED) {
1430
        apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
1431
      if (NULL != (hstripped_not_modified = apr_table_get(r->subprocess_env, "hstripped_not_modified"))
1432
        && (strcasecmp(hstripped_not_modified, "old"))) {
1433
         apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
1431
                     (void *) &h, r->headers_out,
1434
                     (void *) &h, r->headers_out,
1432
                     "Connection",
1435
                     "Connection",
1433
                     "Keep-Alive",
1436
                     "Keep-Alive",
Lines 1442-1450 Link Here
1442
                     "Set-Cookie",
1445
                     "Set-Cookie",
1443
                     "Set-Cookie2",
1446
                     "Set-Cookie2",
1444
                     NULL);
1447
                     NULL);
1445
    }
1448
      } else {
1446
    else {
1449
        /*
1450
         * List of headers that must not be updated on a 304 (or 206 partial content)
1451
         * https://tools.ietf.org/id/draft-ietf-httpbis-cache-08.txt
1452
         */
1453
        apr_table_unset(r->headers_out, "Content_Encoding");
1454
        apr_table_unset(r->headers_out, "Content_Length");
1455
        apr_table_unset(r->headers_out, "Content_MD5");
1456
        apr_table_unset(r->headers_out, "Content_Range");
1457
        apr_table_unset(r->headers_out, "ETag");
1458
        apr_table_unset(r->headers_out, "TE");
1459
        apr_table_unset(r->headers_out, "Trailer");
1460
        apr_table_unset(r->headers_out, "Transfer_Encoding");
1461
        apr_table_unset(r->headers_out, "Upgrade");
1447
        send_all_header_fields(&h, r);
1462
        send_all_header_fields(&h, r);
1463
      }
1464
    } else {
1465
      send_all_header_fields(&h, r);
1448
    }
1466
    }
1449
1467
1450
    terminate_header(b2);
1468
    terminate_header(b2);

Return to bug 61820