Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
d71cc2dd
Commit
d71cc2dd
authored
Dec 07, 2012
by
djcp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure the handle is closed after using OpenURI to get a remote file
parent
7e6b5b6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
lib/paperclip/io_adapters/uri_adapter.rb
+1
-0
test/io_adapters/uri_adapter_test.rb
+4
-0
No files found.
lib/paperclip/io_adapters/uri_adapter.rb
View file @
d71cc2dd
...
...
@@ -32,6 +32,7 @@ module Paperclip
while
data
=
src
.
read
(
16
*
1024
)
destination
.
write
(
data
)
end
src
.
close
destination
.
rewind
destination
end
...
...
test/io_adapters/uri_adapter_test.rb
View file @
d71cc2dd
...
...
@@ -14,6 +14,10 @@ class UriProxyTest < Test::Unit::TestCase
assert_equal
"thoughtbot-logo.png"
,
@subject
.
original_filename
end
should
'close open handle after reading'
do
assert_equal
true
,
@open_return
.
closed?
end
should
"return a content type"
do
assert_equal
"image/png"
,
@subject
.
content_type
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment