|
31 | 31 |
|
32 | 32 | boolFalsePos bool |
33 | 33 | boolFalseNeg bool |
| 34 | + |
| 35 | + cb_method bool |
| 36 | + cb_cookie bool |
| 37 | + cb_parameter bool |
| 38 | + cb_header bool |
34 | 39 | ) |
35 | 40 |
|
36 | 41 | const misshitdif = 30 |
@@ -122,6 +127,11 @@ func CheckCache(stat string) (CacheStruct, []error) { |
122 | 127 | cachebuster = map[string]int{} |
123 | 128 | } |
124 | 129 |
|
| 130 | + cb_method = false |
| 131 | + cb_cookie = false |
| 132 | + cb_parameter = false |
| 133 | + cb_header = false |
| 134 | + |
125 | 135 | boolFalseNeg = false |
126 | 136 | boolFalsePos = false |
127 | 137 |
|
@@ -201,19 +211,19 @@ func CheckCache(stat string) (CacheStruct, []error) { |
201 | 211 | //} |
202 | 212 |
|
203 | 213 | totalCachebusters := "comb_" |
204 | | - if cache.CBisCookie { |
205 | | - addCachebusterMap("total_cookies") |
206 | | - totalCachebusters += "cookie" |
207 | | - } |
208 | | - if cache.CBisHTTPMethod { |
| 214 | + if cb_method { |
209 | 215 | addCachebusterMap("total_httpmethods") |
210 | 216 | totalCachebusters += "httpmethod" |
211 | 217 | } |
212 | | - if cache.CBisHeader { |
| 218 | + if cb_cookie { |
| 219 | + addCachebusterMap("total_cookies") |
| 220 | + totalCachebusters += "cookie" |
| 221 | + } |
| 222 | + if cb_header { |
213 | 223 | addCachebusterMap("total_headers") |
214 | 224 | totalCachebusters += "header" |
215 | 225 | } |
216 | | - if cache.CBisParameter { |
| 226 | + if cb_parameter { |
217 | 227 | addCachebusterMap("total_parameters") |
218 | 228 | totalCachebusters += "parameter" |
219 | 229 | } |
@@ -405,6 +415,7 @@ func cachebusterCookie(cache *CacheStruct) []error { |
405 | 415 | cache.CBisHeader = false |
406 | 416 | cache.CBisParameter = false |
407 | 417 | cache.CBName = Config.Website.Cookies[i].Name |
| 418 | + cb_cookie = true |
408 | 419 | addHitMissIndicatorMap("time") |
409 | 420 | addCachebusterMap("cookie_" + Config.Website.Cookies[i].Name) |
410 | 421 |
|
@@ -518,6 +529,7 @@ func cachebusterCookie(cache *CacheStruct) []error { |
518 | 529 | cache.CBisHeader = false |
519 | 530 | cache.CBisParameter = false |
520 | 531 | cache.CBName = Config.Website.Cookies[i].Name |
| 532 | + cb_cookie = true |
521 | 533 | addCachebusterMap("cookie_" + Config.Website.Cookies[i].Name) |
522 | 534 |
|
523 | 535 | msg := fmt.Sprintf("%s was successful (Cookie)\n", identifier) |
@@ -616,6 +628,7 @@ func cachebusterHeader(cache *CacheStruct) []error { |
616 | 628 | cache.CBisHTTPMethod = false |
617 | 629 | cache.CBisParameter = false |
618 | 630 | cache.CBName = header |
| 631 | + cb_header = true |
619 | 632 | addHitMissIndicatorMap("time") |
620 | 633 | addCachebusterMap("header_" + header) |
621 | 634 |
|
@@ -735,6 +748,7 @@ func cachebusterHeader(cache *CacheStruct) []error { |
735 | 748 | cache.CBisHTTPMethod = false |
736 | 749 | cache.CBisParameter = false |
737 | 750 | cache.CBName = header |
| 751 | + cb_header = true |
738 | 752 | addCachebusterMap("header_" + header) |
739 | 753 |
|
740 | 754 | msg := fmt.Sprintf("%s was successful (Header)\n", identifier) |
@@ -812,6 +826,7 @@ func cachebusterParameter(cache *CacheStruct) error { |
812 | 826 | cache.CBisCookie = false |
813 | 827 | cache.CBisHTTPMethod = false |
814 | 828 | cache.CBName = Config.CacheBuster |
| 829 | + cb_parameter = true |
815 | 830 | addHitMissIndicatorMap("time") |
816 | 831 | addCachebusterMap(Config.CacheBuster) |
817 | 832 |
|
@@ -912,6 +927,7 @@ func cachebusterParameter(cache *CacheStruct) error { |
912 | 927 | cache.CBisCookie = false |
913 | 928 | cache.CBisHTTPMethod = false |
914 | 929 | cache.CBName = Config.CacheBuster |
| 930 | + cb_parameter = true |
915 | 931 | addCachebusterMap(Config.CacheBuster) |
916 | 932 |
|
917 | 933 | msg := fmt.Sprintf("%s was successful (Parameter)\n", identifier) |
@@ -1010,6 +1026,7 @@ func cachebusterHTTPMethod(cache *CacheStruct) []error { |
1010 | 1026 | cache.CBisHeader = false |
1011 | 1027 | cache.CBisCookie = false |
1012 | 1028 | cache.CBName = method |
| 1029 | + cb_method = true |
1013 | 1030 | addHitMissIndicatorMap("time") |
1014 | 1031 | addCachebusterMap("method_" + method) |
1015 | 1032 |
|
@@ -1110,6 +1127,7 @@ func cachebusterHTTPMethod(cache *CacheStruct) []error { |
1110 | 1127 | cache.CBisHeader = false |
1111 | 1128 | cache.CBisCookie = false |
1112 | 1129 | cache.CBName = method |
| 1130 | + cb_method = true |
1113 | 1131 | addCachebusterMap("method_" + method) |
1114 | 1132 |
|
1115 | 1133 | msg := fmt.Sprintf("%s was successful (HTTP Method)\n", identifier) |
|
0 commit comments