comparison src/luan/modules/http/Http.luan @ 1213:d5d5d29d7592

fix cookie bug
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 14 Mar 2018 18:50:18 -0600
parents f9136432847e
children b6aa2cd51b02
comparison
equal deleted inserted replaced
1212:220228bf1af9 1213:d5d5d29d7592
96 end 96 end
97 end 97 end
98 98
99 function this.set_cookie(name,value,attributes) 99 function this.set_cookie(name,value,attributes)
100 attributes = attributes or {} 100 attributes = attributes or {}
101 attributes["Path"] = attributes["Path"] or "/"
101 local attrMap = HashMap.new() 102 local attrMap = HashMap.new()
102 for attr_name, attr_value in pairs(attributes) do 103 for attr_name, attr_value in pairs(attributes) do
103 type(attr_name)=="string" or "cookie attribute name must be string" 104 type(attr_name)=="string" or "cookie attribute name must be string"
104 type(attr_value)=="string" or "cookie attribute value must be string" 105 type(attr_value)=="string" or "cookie attribute value must be string"
105 attrMap.put(attr_name,attr_value) 106 attrMap.put(attr_name,attr_value)