| 2577 | } |
| 2578 | |
| 2579 | PROXY_DECLARE(int) ap_proxy_canon_url(request_rec *r) |
| 2580 | { |
| 2581 | char *url, *p; |
| 2582 | int access_status; |
| 2583 | proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config, |
| 2584 | &proxy_module); |
| 2585 | |
| 2586 | if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0) |
| 2587 | return DECLINED; |
| 2588 | |
| 2589 | /* Put the UDS path appart if any (and not already stripped) */ |
| 2590 | if (r->proxyreq == PROXYREQ_REVERSE) { |
| 2591 | access_status = fixup_uds_filename(r); |
| 2592 | if (ap_is_HTTP_ERROR(access_status)) { |
| 2593 | return access_status; |
| 2594 | } |
| 2595 | } |
| 2596 | |
| 2597 | /* Keep this after fixup_uds_filename() */ |
| 2598 | url = apr_pstrdup(r->pool, r->filename + 6); |
| 2599 | |
| 2600 | if ((dconf->interpolate_env == 1) && (r->proxyreq == PROXYREQ_REVERSE)) { |
| 2601 | /* create per-request copy of reverse proxy conf, |
| 2602 | * and interpolate vars in it |
| 2603 | */ |
| 2604 | proxy_req_conf *rconf = apr_palloc(r->pool, sizeof(proxy_req_conf)); |
| 2605 | ap_set_module_config(r->request_config, &proxy_module, rconf); |
| 2606 | rconf->raliases = proxy_vars(r, dconf->raliases); |
| 2607 | rconf->cookie_paths = proxy_vars(r, dconf->cookie_paths); |
| 2608 | rconf->cookie_domains = proxy_vars(r, dconf->cookie_domains); |
| 2609 | } |
| 2610 | |
| 2611 | /* canonicalise each specific scheme */ |
| 2612 | if ((access_status = proxy_run_canon_handler(r, url))) { |
| 2613 | return access_status; |
| 2614 | } |
| 2615 | |
| 2616 | p = strchr(url, ':'); |
| 2617 | if (p == NULL || p == url) |
| 2618 | return HTTP_BAD_REQUEST; |
| 2619 | |
| 2620 | return OK; /* otherwise; we've done the best we can */ |
| 2621 | } |
| 2622 | |
| 2623 | PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker, |
| 2624 | proxy_balancer **balancer, |
no test coverage detected