| 368 | } |
| 369 | |
| 370 | static void process_proxy_header(apr_table_t *headers, h2_proxy_stream *stream, |
| 371 | const char *n, const char *v) |
| 372 | { |
| 373 | static const struct { |
| 374 | const char *name; |
| 375 | ap_proxy_header_reverse_map_fn func; |
| 376 | } transform_hdrs[] = { |
| 377 | { "Location", ap_proxy_location_reverse_map }, |
| 378 | { "Content-Location", ap_proxy_location_reverse_map }, |
| 379 | { "URI", ap_proxy_location_reverse_map }, |
| 380 | { "Destination", ap_proxy_location_reverse_map }, |
| 381 | { "Set-Cookie", ap_proxy_cookie_reverse_map }, |
| 382 | { NULL, NULL } |
| 383 | }; |
| 384 | request_rec *r = stream->r; |
| 385 | proxy_dir_conf *dconf; |
| 386 | int i; |
| 387 | |
| 388 | dconf = ap_get_module_config(r->per_dir_config, &proxy_module); |
| 389 | if (!dconf->preserve_host) { |
| 390 | for (i = 0; transform_hdrs[i].name; ++i) { |
| 391 | if (!ap_cstr_casecmp(transform_hdrs[i].name, n)) { |
| 392 | apr_table_add(headers, n, (*transform_hdrs[i].func)(r, dconf, v)); |
| 393 | return; |
| 394 | } |
| 395 | } |
| 396 | if (!ap_cstr_casecmp("Link", n)) { |
| 397 | dconf = ap_get_module_config(r->per_dir_config, &proxy_module); |
| 398 | apr_table_add(headers, n, h2_proxy_link_reverse_map(r, dconf, |
| 399 | stream->real_server_uri, stream->p_server_uri, v)); |
| 400 | return; |
| 401 | } |
| 402 | } |
| 403 | apr_table_add(headers, n, v); |
| 404 | } |
| 405 | |
| 406 | static apr_status_t h2_proxy_stream_add_header_out(h2_proxy_stream *stream, |
| 407 | const char *n, apr_size_t nlen, |
no test coverage detected