#define CONVRULE_Z2H_NUM_OFF_BIT (0x00000100)
#define CONVRULE_QSCONV_OFF_BIT (0x00000200)
#define CONVRULE_JRCONV_OFF_BIT (0x00000400)
+#define CONVRULE_NOCACHE_ON_BIT (0x00000800)
#define CONVRULE_ENGINE_ON_CMD "EngineOn"
#define CONVRULE_ENGINE_OFF_CMD "EngineOff"
#define CONVRULE_Z2H_ALL_OFF_CMD "Z2hAllOff"
#define CONVRULE_QSCONV_OFF_CMD "QSConvOff"
#define CONVRULE_JRCONV_OFF_CMD "JRConvOff"
+#define CONVRULE_NOCACHE_ON_CMD "NoCacheOn"
#define CONVRULE_FLAG_NOTMATCH (0x00000001)
static void s_convert_guid_parameter_to_header(request_rec *r, const char *param, device_table *spec);
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);
+static void s_add_no_cache_headers(request_rec *r, chxjconvrule_entry *entryp);
/**
* Only when User-Agent is specified, the User-Agent header is camouflaged.
/**
+ * Add No Cache Header
+ */
+static void
+s_add_no_cache_headers(request_rec *r, chxjconvrule_entry *entryp)
+{
+ if (entryp->action & CONVRULE_NOCACHE_ON_BIT) {
+ apr_table_unset(r->headers_out, "Pragma");
+ apr_table_unset(r->err_headers_out, "Pragma");
+ apr_table_unset(r->headers_out, "Expires");
+ apr_table_unset(r->err_headers_out, "Expires");
+ apr_table_unset(r->headers_out, "Cache-Control");
+ apr_table_unset(r->err_headers_out, "Cache-Control");
+
+ apr_table_setn(r->err_headers_out, "Pragma", "no-cache");
+ apr_table_setn(r->err_headers_out, "Expires", "Thu, 01 Jan 1970 00:00:00 GMT");
+ apr_table_setn(r->err_headers_out, "Cache-Control", "no-cache, no-store");
+ }
+}
+
+
+/**
* It is the main loop of the output filter.
*
* @param f [i/o] It is a filter.
r->status = HTTP_MOVED_TEMPORARILY;
}
}
+ s_add_no_cache_headers(r, entryp);
ap_pass_brigade(f->next, bb);
DBG(f->r, "REQ[%X] end of chxj_output_filter()", (unsigned int)(apr_size_t)r);
return APR_SUCCESS;
}
}
chxj_cookie_unlock(r,lock);
+ s_add_no_cache_headers(r, entryp);
rv = pass_data_to_filter(f,
(const char *)ctx->buffer,
(apr_size_t)ctx->len);
}
apr_table_setn(r->headers_out, "Content-Length", "0");
DBG(r, "REQ[%X] call pass_data_to_filter()", (unsigned int)(apr_size_t)r);
+ s_add_no_cache_headers(r, entryp);
rv = pass_data_to_filter(f, (const char *)"", (apr_size_t)0);
DBG(f->r, "REQ[%X] end of chxj_output_filter()", (unsigned int)(apr_size_t)r);
return rv;
}
break;
+ case 'N':
+ case 'n':
+ if (strcasecmp(CONVRULE_NOCACHE_ON_CMD, action) == 0) {
+ newrule->action |= CONVRULE_NOCACHE_ON_BIT;
+ }
+ break;
+
case 'Q':
case 'q':
if (strcasecmp(CONVRULE_QSCONV_OFF_CMD, action) == 0) {