summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/uris.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/mixin/uris.rb')
-rw-r--r--lib/chef/mixin/uris.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/mixin/uris.rb b/lib/chef/mixin/uris.rb
index 7dc04d662b..ea55eefd8f 100644
--- a/lib/chef/mixin/uris.rb
+++ b/lib/chef/mixin/uris.rb
@@ -31,12 +31,10 @@ class Chef
end
def as_uri(source)
- begin
- URI.parse(source)
- rescue URI::InvalidURIError
- Chef::Log.warn("#{source} was an invalid URI. Trying to escape invalid characters")
- URI.parse(Addressable::URI.encode(source))
- end
+ URI.parse(source)
+ rescue URI::InvalidURIError
+ Chef::Log.warn("#{source} was an invalid URI. Trying to escape invalid characters")
+ URI.parse(Addressable::URI.encode(source))
end
end