Skip to content

Commit

Permalink
uri objects now return nil for ssl? instead of true/false in case the…
Browse files Browse the repository at this point in the history
… scheme is missing
  • Loading branch information
rubiii committed Mar 17, 2010
1 parent 80d4c8e commit 83528a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/savon/core_ext/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Generic

# Returns whether the URI hints to SSL.
def ssl?
@scheme.starts_with? "https"
!@scheme ? nil : @scheme.starts_with?("https")
end

end
Expand Down
4 changes: 4 additions & 0 deletions spec/savon/core_ext/uri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
it "returns false for non-https URI's" do
URI("http://example.com").ssl?.should be_false
end

it "returns nil for invalid URI's without a scheme" do
URI("example").ssl?.should be_nil
end
end

end

0 comments on commit 83528a1

Please sign in to comment.