Override the default status code if not suitable to redirect action

Issue #1850
This commit is contained in:
Felipe Zimmerle 2018-10-30 18:18:05 -03:00
parent bfe917b6b1
commit e1e8a01ed2
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
4 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,8 @@
v3.0.3 - YYYY-MMM-DD (to be released)
-------------------------------------
- Override the default status code if not suitable to redirect action
[Issue #1850 - @zimmerle, @victorhora]
- parser: Fix the support for CRLF configuration files
[Issue #1945 - @zimmerle, @defanator, @kjakub]
- Organizes the server logs

@ -1 +1 @@
Subproject commit 54e9a6ec017c687c8fad1f347a263a7b259f8525
Subproject commit bf234eb2f385b969c4f803b35fda53cffdd93922

View File

@ -38,7 +38,8 @@ bool Redirect::evaluate(Rule *rule, Transaction *transaction,
std::shared_ptr<RuleMessage> rm) {
std::string m_urlExpanded(m_string->evaluate(transaction));
/* if it was changed before, lets keep it. */
if (transaction->m_it.status == 200) {
if (transaction->m_it.status == 200
|| (!(transaction->m_it.status <= 307 && transaction->m_it.status >= 301))) {
transaction->m_it.status = m_status;
}

@ -1 +1 @@
Subproject commit a9c58a25771493ac2abadffbfd5dce1213d5db93
Subproject commit e6b03e46046ce9ce6dcfc0e6ad0820194e21db35