|
|
|
|
@@ -44,17 +44,17 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
|
|
|
|
|
w_res.put_header_text (l_header.string)
|
|
|
|
|
w_res.add_cookie (l_cookie)
|
|
|
|
|
w_res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
|
|
|
|
w_res.put_string ("Test")
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_add_multiple_cookiewith_similar_cookie_name
|
|
|
|
|
test_add_multiple_cookies_with_similar_cookie_name
|
|
|
|
|
local
|
|
|
|
|
w_res: WSF_RESPONSE
|
|
|
|
|
l_cookie: WSF_COOKIE
|
|
|
|
|
@@ -73,7 +73,7 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
w_res.put_header_text (l_header.string)
|
|
|
|
|
w_res.add_cookie (l_cookie)
|
|
|
|
|
|
|
|
|
|
@@ -84,16 +84,16 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=newUser; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=newUser; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
|
|
|
|
|
w_res.add_cookie (l_cookie) -- Ignored
|
|
|
|
|
w_res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
|
|
|
|
w_res.put_string ("Test")
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_add_multiple_cookie_with_similar_cookie_name_2
|
|
|
|
|
test_add_multiple_cookies_with_similar_cookie_name_2
|
|
|
|
|
local
|
|
|
|
|
w_res: WSF_RESPONSE
|
|
|
|
|
l_cookie: WSF_COOKIE
|
|
|
|
|
@@ -113,7 +113,7 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w_res.add_cookie (l_cookie)
|
|
|
|
|
@@ -123,7 +123,7 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=newUser; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: user_id=newUser; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
|
|
|
|
|
w_res.add_cookie (l_cookie) -- Ignored
|
|
|
|
|
|
|
|
|
|
@@ -134,11 +134,11 @@ feature -- Test Cases
|
|
|
|
|
l_cookie.set_path ("/")
|
|
|
|
|
l_cookie.set_secure (True)
|
|
|
|
|
l_cookie.set_http_only (True)
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: ewf_sessionid=test; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly"))
|
|
|
|
|
assert("Expected", l_cookie.header_line.same_string ("Set-Cookie: ewf_sessionid=test; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly"))
|
|
|
|
|
|
|
|
|
|
w_res.add_cookie (l_cookie)
|
|
|
|
|
w_res.set_status_code ({HTTP_STATUS_CODE}.ok)
|
|
|
|
|
w_res.put_string ("Test")
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly%R%NSet-Cookie: ewf_sessionid=test; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Max-Age=-1; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
assert ("Expected", l_res.output.same_string("200 %R%NContent-Type: text/html%R%NSet-Cookie: user_id=u12345; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly%R%NSet-Cookie: ewf_sessionid=test; Domain=www.example.com; Path=/; Expires=Sat, 18 Apr 2015 21:22:05 GMT; Secure; HttpOnly%R%N%R%NTest") )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|