Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wasn't handling boolean query values consistently.

  • Loading branch information...
commit 004b3bb4a8283eb1a9471a4582eaf8e3100f0ec3 1 parent aac36de
@sporkmonger authored
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/addressable/uri.rb
View
7 lib/addressable/uri.rb
@@ -1439,11 +1439,6 @@ def query_values(return_type=Hash)
# but in this case I really want to maintain the exact pair structure,
# so it's best to make all changes in-place.
pair[0] = URI.unencode_component(pair[0])
- # This looks weird, but it's correct. Handles query values like:
- # ?data=1&flag&color=blue
- # In this case, `flag` would evaluate to `true`, which is what you
- # want. Its absence implies that `flag` resolves to `false`.
- # value = true if value.nil?
if pair[1].respond_to?(:to_str)
# I loathe the fact that I have to do this. Stupid HTML 4.01.
# Treating '+' as a space was just an unbelievably bad idea.
@@ -1506,7 +1501,7 @@ def query_values=(new_query_values)
encoded_key = URI.encode_component(
key, CharacterClasses::UNRESERVED
)
- if value == nil || value == true
+ if value == nil
buffer << "#{encoded_key}&"
elsif value.kind_of?(Array)
value.each do |sub_value|
Please sign in to comment.
Something went wrong with that request. Please try again.