1 |
int translate_path(request_rec *r) { |
2 |
char *uri = r->uri; |
3 |
request_rec *subr; |
4 |
char *type = NULL; |
5 |
extern do_czs; |
6 |
|
7 |
do_czs=0; |
8 |
|
9 |
#ifdef DEBUG |
10 |
ap_table_setn(r->headers_out, "X-translate", r->uri); |
11 |
#endif |
12 |
if (uri[0]=='/' && uri[1]=='c' && uri[2]=='z' && uri[3]=='s') { |
13 |
#if 0 |
14 |
ap_table_setn(r->headers_out, "Location", ap_pstrcat(r->pool, uri+2, "?czs", NULL)); |
15 |
return REDIRECT; |
16 |
#endif |
17 |
subr = (request_rec *) ap_sub_req_lookup_uri(r->uri+4, r); |
18 |
r->filename=ap_pstrdup(r->pool, subr->filename); |
19 |
type = subr->content_type; |
20 |
#ifdef DEBUG |
21 |
ap_table_setn(r->headers_out, "X-translate-content-type", type); |
22 |
#endif |
23 |
if (type == NULL) { |
24 |
return DECLINED; /* hm? */ |
25 |
} |
26 |
do_czs=1; |
27 |
ap_destroy_sub_req(subr); |
28 |
#ifdef XHEADER |
29 |
# ifdef DEBUG |
30 |
ap_table_setn(r->headers_out, "X-debug", XHEADER); |
31 |
# endif |
32 |
#endif |
33 |
return OK; |
34 |
} |
35 |
|
36 |
return DECLINED; |
37 |
} |