* add 'http[s]://ourhost[:ourport]/' to URI * if URI is still not fully qualified */
| 969 | * if URI is still not fully qualified |
| 970 | */ |
| 971 | static void fully_qualify_uri(request_rec *r) |
| 972 | { |
| 973 | if (r->method_number == M_CONNECT) { |
| 974 | return; |
| 975 | } |
| 976 | else if (!is_absolute_uri(r->filename, NULL)) { |
| 977 | const char *thisserver; |
| 978 | char *thisport; |
| 979 | int port; |
| 980 | |
| 981 | thisserver = ap_get_server_name_for_url(r); |
| 982 | port = ap_get_server_port(r); |
| 983 | thisport = ap_is_default_port(port, r) |
| 984 | ? "" |
| 985 | : apr_psprintf(r->pool, ":%u", port); |
| 986 | |
| 987 | r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", |
| 988 | ap_http_scheme(r), thisserver, thisport, |
| 989 | (*r->filename == '/') ? "" : "/", |
| 990 | r->filename); |
| 991 | } |
| 992 | |
| 993 | return; |
| 994 | } |
| 995 | |
| 996 | static int startsWith(request_rec *r, const char *haystack, const char *needle) { |
| 997 | int rc = (ap_strstr_c(haystack, needle) == haystack); |
no test coverage detected