Extends the direct access model to other collections

This commit is contained in:
Felipe Zimmerle
2017-01-26 23:13:38 -03:00
committed by Felipe Zimmerle
parent ca24b6bb06
commit f2d149fc5f
157 changed files with 7711 additions and 4959 deletions

View File

@@ -32,7 +32,7 @@ namespace disruptive {
bool Block::evaluate(Rule *rule, Transaction *transaction, RuleMessage *rm) {
transaction->debug(8, "Marking request as disruptive.");
for (Action *a : transaction->m_rules->m_defaultActions[rule->phase]) {
for (Action *a : transaction->m_rules->m_defaultActions[rule->m_phase]) {
if (a->isDisruptive() == false) {
continue;
}

View File

@@ -39,7 +39,7 @@ bool Deny::evaluate(Rule *rule, Transaction *transaction, RuleMessage *rm) {
log.append("Access denied with code %d");
log.append(" (phase ");
log.append(std::to_string(rm->m_rule->phase - 1) + "). ");
log.append(std::to_string(rm->m_rule->m_phase - 1) + "). ");
transaction->m_it.disruptive = true;
intervention::freeLog(&transaction->m_it);

View File

@@ -46,7 +46,7 @@ bool Redirect::evaluate(Rule *rule, Transaction *transaction,
}
log.append("Access denied with code %d");
log.append(" (phase ");
log.append(std::to_string(rm->m_rule->phase - 1) + "). ");
log.append(std::to_string(rm->m_rule->m_phase - 1) + "). ");
intervention::freeUrl(&transaction->m_it);
transaction->m_it.url = strdup(m_urlExpanded.c_str());