Fixing issue with experimental WGI_MULTIPLE_STRING_VALUE
Fixed issue with RAW_POST_DATA
This commit is contained in:
@@ -14,6 +14,7 @@ inherit
|
|||||||
|
|
||||||
create
|
create
|
||||||
make_with_value,
|
make_with_value,
|
||||||
|
make_with_array,
|
||||||
make_with_string
|
make_with_string
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
@@ -25,6 +26,26 @@ feature {NONE} -- Initialization
|
|||||||
add_value (a_value)
|
add_value (a_value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
make_with_array (arr: ARRAY [WGI_VALUE])
|
||||||
|
require
|
||||||
|
arr_not_empty: not arr.is_empty
|
||||||
|
all_same_name: across arr as c all c.item.name.same_string (arr[arr.lower].name) end
|
||||||
|
local
|
||||||
|
i,up: INTEGER
|
||||||
|
do
|
||||||
|
up := arr.upper
|
||||||
|
i := arr.lower
|
||||||
|
make_with_value (arr[i])
|
||||||
|
from
|
||||||
|
i := i + 1
|
||||||
|
until
|
||||||
|
i > up
|
||||||
|
loop
|
||||||
|
add_value (arr[i])
|
||||||
|
i := i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
make_with_string (a_name: like name; a_string: READABLE_STRING_32)
|
make_with_string (a_name: like name; a_string: READABLE_STRING_32)
|
||||||
do
|
do
|
||||||
make_with_value (create {WGI_STRING_VALUE}.make (a_name, a_string))
|
make_with_value (create {WGI_STRING_VALUE}.make (a_name, a_string))
|
||||||
@@ -75,7 +96,7 @@ feature -- Helper
|
|||||||
across
|
across
|
||||||
string_values as c
|
string_values as c
|
||||||
loop
|
loop
|
||||||
if Result.count = 1 then
|
if Result.count > 1 then
|
||||||
Result.append_character (',')
|
Result.append_character (',')
|
||||||
end
|
end
|
||||||
Result.append_string (c.item)
|
Result.append_string (c.item)
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ feature {NONE} -- Query parameters: implementation
|
|||||||
n, p, i, j: INTEGER
|
n, p, i, j: INTEGER
|
||||||
s: STRING
|
s: STRING
|
||||||
l_name,l_value: STRING_32
|
l_name,l_value: STRING_32
|
||||||
|
v: WGI_VALUE
|
||||||
do
|
do
|
||||||
if a_content = Void then
|
if a_content = Void then
|
||||||
create Result.make (0)
|
create Result.make (0)
|
||||||
@@ -479,7 +480,17 @@ feature {NONE} -- Query parameters: implementation
|
|||||||
l_name := url_encoder.decoded_string (l_name)
|
l_name := url_encoder.decoded_string (l_name)
|
||||||
l_value := url_encoder.decoded_string (l_value)
|
l_value := url_encoder.decoded_string (l_value)
|
||||||
end
|
end
|
||||||
Result.force (new_string_value (l_name, l_value), l_name)
|
v := new_string_value (l_name, l_value)
|
||||||
|
if Result.has_key (l_name) and then attached Result.found_item as l_existing_value then
|
||||||
|
if attached {WGI_MULTIPLE_STRING_VALUE} l_existing_value as l_multi then
|
||||||
|
l_multi.add_value (v)
|
||||||
|
else
|
||||||
|
Result.force (create {WGI_MULTIPLE_STRING_VALUE}.make_with_array (<<l_existing_value, v>>), l_name)
|
||||||
|
check replaced: Result.found and then Result.found_item ~ l_existing_value end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result.force (v, l_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -515,7 +526,7 @@ feature {NONE} -- Form fields and related
|
|||||||
vars := urlencoded_parameters (s, True)
|
vars := urlencoded_parameters (s, True)
|
||||||
end
|
end
|
||||||
if raw_post_data_recorded then
|
if raw_post_data_recorded then
|
||||||
vars.force (new_string_value ("RAW_POST_DATA", s), "RAW_POST_DATA")
|
set_meta_string_variable ("RAW_POST_DATA", s)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
create vars.make (0)
|
create vars.make (0)
|
||||||
|
|||||||
Reference in New Issue
Block a user