whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] 01/03: Untaint unnecessary here
Date Tue, 29 Sep 2020 21:35:51 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 7b21b502b704f04af0233f20673ac39e44540336
Author: Sebb <sebb@apache.org>
AuthorDate: Tue Sep 29 22:18:39 2020 +0100

    Untaint unnecessary here
---
 lib/whimsy/public.rb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/public.rb b/lib/whimsy/public.rb
index 392cf82..87d0e55 100644
--- a/lib/whimsy/public.rb
+++ b/lib/whimsy/public.rb
@@ -3,7 +3,6 @@
 #
 
 require 'json'
-#require 'wunderbar'
 require 'net/https'
 require 'fileutils'
 
@@ -14,14 +13,13 @@ module Public
   # contents of a given public file, read from local copy if possible,
   # fetched from the web otherwise
   def self.getfile(pubname)
-    local_copy = File.expand_path('../../../www/public/'+pubname, __FILE__.untaint).untaint
+    local_copy = File.expand_path('../../../www/public/' + pubname, __FILE__)
     if File.exist? local_copy
-#      Wunderbar.info "Using local copy of #{pubname}"
       File.read(local_copy)
     else
-#      Wunderbar.info "Fetching remote copy of #{pubname}"
-      response = Net::HTTP.get_response(URI(DATAURI+pubname))
+      response = Net::HTTP.get_response(URI(DATAURI + pubname))
       raise ArgumentError, "'#{pubname}' #{response.message}" unless response.is_a?(Net::HTTPSuccess)
+
       response.body
     end
   end


Mime
View raw message