aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick/httpauth
diff options
context:
space:
mode:
Diffstat (limited to 'lib/webrick/httpauth')
-rw-r--r--lib/webrick/httpauth/htdigest.rb2
-rw-r--r--lib/webrick/httpauth/htpasswd.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/webrick/httpauth/htdigest.rb b/lib/webrick/httpauth/htdigest.rb
index 1ef4fdb4aa..1b42c02dfa 100644
--- a/lib/webrick/httpauth/htdigest.rb
+++ b/lib/webrick/httpauth/htdigest.rb
@@ -79,7 +79,7 @@ module WEBrick
File::rename(tmp.path, output)
renamed = true
ensure
- tmp.close if !tmp.closed?
+ tmp.close
File.unlink(tmp.path) if !renamed
end
end
diff --git a/lib/webrick/httpauth/htpasswd.rb b/lib/webrick/httpauth/htpasswd.rb
index f43fc2c548..8c7b09463b 100644
--- a/lib/webrick/httpauth/htpasswd.rb
+++ b/lib/webrick/httpauth/htpasswd.rb
@@ -84,7 +84,7 @@ module WEBrick
File::rename(tmp.path, output)
renamed = true
ensure
- tmp.close if !tmp.closed?
+ tmp.close
File.unlink(tmp.path) if !renamed
end
end