@@ -71,6 +71,14 @@ class ConfigString {
71
71
};
72
72
73
73
74
+ class ConfigSet {
75
+ public:
76
+ ConfigSet () : m_set(false ), m_clear(false ) { }
77
+ bool m_set;
78
+ bool m_clear;
79
+ std::set<std::string> m_value;
80
+ };
81
+
74
82
class RulesProperties {
75
83
public:
76
84
RulesProperties () :
@@ -334,10 +342,18 @@ class RulesProperties {
334
342
to->m_components .insert (to->m_components .end (),
335
343
from->m_components .begin (), from->m_components .end ());
336
344
337
- for (std::set<std::string>::iterator
338
- it = from->m_responseBodyTypeToBeInspected .begin ();
339
- it != from->m_responseBodyTypeToBeInspected .end (); ++it) {
340
- to->m_responseBodyTypeToBeInspected .insert (*it);
345
+ if (from->m_responseBodyTypeToBeInspected .m_set == true ) {
346
+ if (from->m_responseBodyTypeToBeInspected .m_clear == true ) {
347
+ to->m_responseBodyTypeToBeInspected .m_value .clear ();
348
+ from->m_responseBodyTypeToBeInspected .m_value .clear ();
349
+ } else {
350
+ for (std::set<std::string>::iterator
351
+ it = from->m_responseBodyTypeToBeInspected .m_value .begin ();
352
+ it != from->m_responseBodyTypeToBeInspected .m_value .end (); ++it) {
353
+ to->m_responseBodyTypeToBeInspected .m_value .insert (*it);
354
+ }
355
+ }
356
+ to->m_responseBodyTypeToBeInspected .m_set = true ;
341
357
}
342
358
343
359
for (int i = 0 ; i <= modsecurity::Phases::NUMBER_OF_PHASES; i++) {
@@ -447,7 +463,7 @@ class RulesProperties {
447
463
RulesExceptions m_exceptions;
448
464
std::list<std::string> m_components;
449
465
std::ostringstream m_parserError;
450
- std::set<std::string> m_responseBodyTypeToBeInspected;
466
+ ConfigSet m_responseBodyTypeToBeInspected;
451
467
ConfigString m_httpblKey;
452
468
ConfigString m_uploadDirectory;
453
469
ConfigString m_uploadTmpDirectory;
0 commit comments