This repository was archived by the owner on Dec 3, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.1.16 (2015-04-29)
4
+
5
+ * Errors caused by empty HTTP headers. Fixes issue #8
6
+
3
7
## 0.1.15 (2015-04-29)
4
8
5
9
* No max-stale = allow anything. Fixes issue #7
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def format_key
30
30
def clean
31
31
-> ( headers ) {
32
32
Array ( headers ) . reject { |key , value |
33
- HEADERS_NO_CACHE . include? ( key ) || helper_is_if_modified_error? ( key , value )
33
+ HEADERS_NO_CACHE . include? ( key ) || helper_is_if_modified_error? ( key , value ) || value . nil? || value . empty?
34
34
}
35
35
}
36
36
end
Original file line number Diff line number Diff line change @@ -35,4 +35,13 @@ def test_bugfix_7_invalid_validation_of_max_stale
35
35
36
36
assert_kind_of TrueClass , no_max_stale
37
37
end
38
+
39
+ # https://github.com/aw/CacheRules/issues/8
40
+ def test_bugfix_8_errors_caused_by_empty_http_headers
41
+ isnil = CacheRules . clean . call ( { 'Content-Type' => nil } )
42
+ isempty = CacheRules . clean . call ( { 'Content-Type' => '' } )
43
+
44
+ assert_equal isnil , [ ]
45
+ assert_equal isempty , [ ]
46
+ end
38
47
end
You can’t perform that action at this time.
0 commit comments