From 327b5221e8dd3b732b750340440409cdc0207e44 Mon Sep 17 00:00:00 2001 From: konn Date: Thu, 24 Jul 2008 10:18:11 +0000 Subject: [PATCH] * merge from 0.11.13 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_12_0@3065 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- src/chxj_cookie.c | 4 +++- src/mod_chxj.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/chxj_cookie.c b/src/chxj_cookie.c index 389c7506..a09219f6 100644 --- a/src/chxj_cookie.c +++ b/src/chxj_cookie.c @@ -459,7 +459,9 @@ chxj_load_cookie(request_rec *r, char *cookie_id) cookie = (cookie_t*)apr_palloc(r->pool, sizeof(cookie_t)); cookie->cookie_headers = NULL; - cookie->cookie_id = apr_pstrdup(r->pool, cookie_id); + cookie->cookie_id = chxj_url_decode(r->pool, apr_pstrdup(r->pool, cookie_id)); + cookie->cookie_id = chxj_url_encode(r->pool, cookie->cookie_id); + dconf = chxj_get_module_config(r->per_dir_config, &chxj_module); entryp = chxj_apply_convrule(r, dconf->convrules); diff --git a/src/mod_chxj.c b/src/mod_chxj.c index 87672c17..282f12c0 100644 --- a/src/mod_chxj.c +++ b/src/mod_chxj.c @@ -143,6 +143,7 @@ converter_t convert_routine[] = { static int chxj_convert_input_header(request_rec *r,chxjconvrule_entry *entryp); static void s_add_cookie_id_if_has_location_header(request_rec *r, cookie_t *cookie); +static void s_clear_cookie_header(request_rec *r, device_table *spec); /** * Only when User-Agent is specified, the User-Agent header is camouflaged. @@ -172,6 +173,14 @@ chxj_headers_fixup(request_rec *r) DBG(r, "end chxj_headers_fixup()"); return DECLINED; } + if (r->method_number == M_POST) { + if (!apr_table_get(r->headers_in, "X-Chxj-Forward")) { + s_clear_cookie_header(r, spec); + } + } + else { + s_clear_cookie_header(r, spec); + } switch(spec->html_spec_type) { case CHXJ_SPEC_Chtml_1_0: @@ -257,6 +266,28 @@ chxj_headers_fixup(request_rec *r) return DECLINED; } + +static void +s_clear_cookie_header(request_rec *r, device_table *spec) +{ + switch(spec->html_spec_type) { + case CHXJ_SPEC_Chtml_1_0: + case CHXJ_SPEC_Chtml_2_0: + case CHXJ_SPEC_Chtml_3_0: + case CHXJ_SPEC_Chtml_4_0: + case CHXJ_SPEC_Chtml_5_0: + case CHXJ_SPEC_Chtml_6_0: + case CHXJ_SPEC_Chtml_7_0: + case CHXJ_SPEC_XHtml_Mobile_1_0: + case CHXJ_SPEC_Jhtml: + apr_table_unset(r->headers_in, "Cookie"); + break; + default: + break; + } +} + + /** * It converts it from CHTML into XXML corresponding to each model. * -- 2.11.0