mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-05-03 23:43:42 +03:00
Fix regex typo allowing '[' in boundary string
This commit is contained in:
parent
6b8d6019ea
commit
5cbfcbc56f
|
@ -42,7 +42,7 @@ function doAjaxSubmit(e) {
|
||||||
// We need to add a boundary parameter to the header
|
// We need to add a boundary parameter to the header
|
||||||
// We assume the first valid-looking boundary line in the body is correct
|
// We assume the first valid-looking boundary line in the body is correct
|
||||||
// regex is from RFC 2046 appendix A
|
// regex is from RFC 2046 appendix A
|
||||||
var boundaryCharNoSpace = "[0-9A-Z'()+_,-./:=?";
|
var boundaryCharNoSpace = "0-9A-Z'()+_,-./:=?";
|
||||||
var boundaryChar = boundaryCharNoSpace + ' ';
|
var boundaryChar = boundaryCharNoSpace + ' ';
|
||||||
var re = new RegExp('^--([' + boundaryChar + ']{0,69}[' + boundaryCharNoSpace + '])[\\s]*?$', 'im');
|
var re = new RegExp('^--([' + boundaryChar + ']{0,69}[' + boundaryCharNoSpace + '])[\\s]*?$', 'im');
|
||||||
var boundary = data.match(re);
|
var boundary = data.match(re);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user