summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/http/httpd.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-04-04 08:46:08 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-04-04 08:46:08 +0000
commit038525403ebcc1d69436adad9bc1cfabb371dae1 (patch)
tree429e397cb6b10f1d05410e5b42f2630c21083281 /sca-cpp/trunk/modules/http/httpd.hpp
parent37104d47a3ce5234ff708588b68e8d9cbd13131d (diff)
Fix performance and security issues reported by pagespeed and skipfish.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1088508 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/http/httpd.hpp')
-rw-r--r--sca-cpp/trunk/modules/http/httpd.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp
index d9570ce5bd..0dd7920f65 100644
--- a/sca-cpp/trunk/modules/http/httpd.hpp
+++ b/sca-cpp/trunk/modules/http/httpd.hpp
@@ -326,10 +326,10 @@ const failable<int> writeResult(const failable<list<string> >& ls, const string&
ostringstream os;
write(content(ls), os);
const string ob(str(os));
- debug(ob, "httpd::writeResult");
// Make sure browsers come back and check for updated dynamic content
apr_table_setn(r->headers_out, "Expires", "Tue, 01 Jan 1980 00:00:00 GMT");
+ apr_table_setn(r->headers_out, "Cache-Control", "must-revalidate");
// Compute and return an Etag for the returned content
const string etag(ap_md5(r->pool, (const unsigned char*)c_str(ob)));
@@ -339,10 +339,14 @@ const failable<int> writeResult(const failable<list<string> >& ls, const string&
const char* match = apr_table_get(r->headers_in, "If-None-Match");
apr_table_setn(r->headers_out, "ETag", apr_pstrdup(r->pool, c_str(etag)));
if (match != NULL && etag == match) {
-
r->status = HTTP_NOT_MODIFIED;
+ debug(r->status, "httpd::writeResult::status");
return OK;
}
+
+ debug(r->status, "httpd::writeResult::status");
+ debug(ct, "httpd::writeResult::contentType");
+ debug(ob, "httpd::writeResult::content");
ap_set_content_type(r, apr_pstrdup(r->pool, c_str(ct)));
ap_rwrite(c_str(ob), (int)length(ob), r);
return OK;