Chrome不会发送换行符xhttp / javascript

时间:2018-06-26 03:39:04

标签: javascript

当通过javascript通过带有xhttp请求的多行文本框发送输入时,chrome会阻止新行,这是一些新的漏洞利用防护的一部分。我尝试使用encodeURI,但没有执行任何操作,尝试发送
也会导致此错误。我允许用户通过文本框提交html。

编辑:

JavaScript代码:

var taskid = 'task=' + notes;
var cont = '&content=' + po.value;
var head = '&head=' + pp.value;
var comb = taskid+cont+head;
var nlink = 'create.note.php?'+comb;
var encoded = encodeURI(nlink);
xhttp.open('GET', encoded + comb, true);

Chrome浏览器的响应:

[Deprecation] Resource requests whose URLs contained both removed whitespace 
(`\n`, `\r`, `\t`) characters and less-than characters (`<`) are blocked. 
Please remove newlines and encode less-than characters from places like 
element attribute values in order to load these resources. See 
https://www.chromestatus.com/feature/5735596811091968 for more details.

0 个答案:

没有答案