Merge pull request #128 from jocelyn/response_header

Extracting HTTP_HEADER_BUILDER from HTTP_HEADER
Improving wsf session usage
Various unicode related improvement for router and error library.
This commit is contained in:
Jocelyn Fiat
2014-05-14 10:06:58 +02:00
19 changed files with 944 additions and 619 deletions

View File

@@ -1287,41 +1287,43 @@ feature {NONE} -- Cookies
local
i,j,p,n: INTEGER
l_cookies: like internal_cookies_table
s32: READABLE_STRING_32
k,v,s: STRING
do
l_cookies := internal_cookies_table
if l_cookies = Void then
create l_cookies.make_equal (0)
if attached {WSF_STRING} meta_variable ({WSF_META_NAMES}.http_cookie) as val then
s := val.value
create l_cookies.make_equal (5)
from
n := s.count
p := 1
i := 1
until
p < 1
loop
i := s.index_of ('=', p)
if i > 0 then
j := s.index_of (';', i)
if j = 0 then
j := n + 1
k := s.substring (p, i - 1)
v := s.substring (i + 1, n)
s32 := val.value
if s32.is_valid_as_string_8 then
s := s32.to_string_8
from
n := s.count
p := 1
i := 1
until
p < 1
loop
i := s.index_of ('=', p)
if i > 0 then
j := s.index_of (';', i)
if j = 0 then
j := n + 1
k := s.substring (p, i - 1)
v := s.substring (i + 1, n)
p := 0 -- force termination
else
k := s.substring (p, i - 1)
v := s.substring (i + 1, j - 1)
p := j + 1
p := 0 -- force termination
else
k := s.substring (p, i - 1)
v := s.substring (i + 1, j - 1)
p := j + 1
end
k.left_adjust
k.right_adjust
add_value_to_table (k, v, l_cookies)
end
k.left_adjust
k.right_adjust
add_value_to_table (k, v, l_cookies)
end
end
else
create l_cookies.make_equal (0)
end
internal_cookies_table := l_cookies
end