Skip to content

Commit

Permalink
Add tests and changelog entry to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Jan 11, 2016
1 parent c576959 commit 12a7fb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## HEAD

* Prevent multiline content type spoof attempts in validation_helpers (xzo)

* Make custom metadata inherited from uploaded files and make `#extract_metadata` called only on caching (janko-m)

## 1.1.0 (2015-12-26)
Expand Down
7 changes: 7 additions & 0 deletions test/plugin/validation_helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
assert_empty @attacher.errors
end

it "scans multiline strings" do
@attacher.assign(fakeio(content_type: "video/mpeg4\nfoo"))
@attacher.validate_mime_type_inclusion ["video/mpeg4"]

refute_empty @attacher.errors
end

it "accepts regexes" do
@attacher.assign(fakeio(content_type: "video/mpeg4"))
@attacher.validate_mime_type_inclusion [/image/]
Expand Down

0 comments on commit 12a7fb2

Please sign in to comment.