Changed Ajax request detection to prevent browser caching

This commit is contained in:
Peter Schojer
2008-05-19 13:25:44 +00:00
parent ae5b44091f
commit ab07e2cbba
3 changed files with 18 additions and 24 deletions

View File

@@ -485,9 +485,14 @@ std::string Utility::createURI(const std::map<std::string, std::string>& addPara
WebApplication& app = WebApplication::instance();
Renderable::ID id = app.getCurrentPage()->id();
std::ostringstream uri;
uri << "'" << app.getURI().toString() << "?";
uri << RequestHandler::KEY_TYPE << "=" << RequestHandler::VAL_AJAX; //mark as AJAX request
uri << "&" << RequestHandler::KEY_ID << "=" << id;
std::string theUri(app.getURI().toString());
if (theUri.empty())
theUri = "/";
else if (theUri[theUri.length()-1] != '/')
theUri.append("/");
uri << "'" << theUri;
uri << ";"; //mark as AJAX request
uri << RequestHandler::KEY_ID << "=" << id;
// add optional params
bool commaAtEnd = false;
std::size_t cnt(1);