死无对证:tomcat7 + 中文cookie + goLang

时间:2024-04-25 18:00:56

查了下资料,很多人遇到这个问题,但是goLang使用得相对少

java.lang.IllegalArgumentException: Control character in cookie value or attribute

基本解决思路是:服务端url编码 + web端js进行url解码

js解码用:decodeURI(str)

golang如何进行url编码?:url.PathEscape(str),用的包为 "net/url"

感谢:https://studygolang.com/articles/7276