File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
rest_framework/static/rest_framework/js Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ function doAjaxSubmit(e) {
42
42
// We need to add a boundary parameter to the header
43
43
// We assume the first valid-looking boundary line in the body is correct
44
44
// regex is from RFC 2046 appendix A
45
- var re = / ^ - - ( [ 0 - 9 A - Z ' ( ) + _ , - . / : = ? ] { 1 , 70 } ) [ \f \t \v \u00a0 \u1680 \u180e \u2000 - \u200a \u2028 \u2029 \u202f \u205f \u3000 \ufeff ] * $ / im;
45
+ var boundaryCharNoSpace = "[0-9A-Z'()+_,-./:=?" ;
46
+ var boundaryChar = boundaryCharNoSpace + ' ' ;
47
+ var re = new RegExp ( '^--([' + boundaryChar + ']{0,69}[' + boundaryCharNoSpace + '])[\\s]*?$' , 'im' ) ;
46
48
var boundary = data . match ( re ) ;
47
49
if ( boundary !== null ) {
48
50
contentType += '; boundary="' + boundary [ 1 ] + '"' ;
You can’t perform that action at this time.
0 commit comments