Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
6b8d6019
Commit
6b8d6019
authored
May 31, 2017
by
Levi Cameron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix boundary detection regex not handling spaces inside boundary marker correctly
parent
1c44ef2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
rest_framework/static/rest_framework/js/ajax-form.js
+3
-1
No files found.
rest_framework/static/rest_framework/js/ajax-form.js
View file @
6b8d6019
...
@@ -42,7 +42,9 @@ function doAjaxSubmit(e) {
...
@@ -42,7 +42,9 @@ 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
re
=
/^--
([
0-9A-Z'()+_,-.
/
:=?
]{1,70})[
\f\t\v\u
00a0
\u
1680
\u
180e
\u
2000-
\u
200a
\u
2028
\u
2029
\u
202f
\u
205f
\u
3000
\u
feff
]
*$/im
;
var
boundaryCharNoSpace
=
"[0-9A-Z'()+_,-./:=?"
;
var
boundaryChar
=
boundaryCharNoSpace
+
' '
;
var
re
=
new
RegExp
(
'^--(['
+
boundaryChar
+
']{0,69}['
+
boundaryCharNoSpace
+
'])[
\\
s]*?$'
,
'im'
);
var
boundary
=
data
.
match
(
re
);
var
boundary
=
data
.
match
(
re
);
if
(
boundary
!==
null
)
{
if
(
boundary
!==
null
)
{
contentType
+=
'; boundary="'
+
boundary
[
1
]
+
'"'
;
contentType
+=
'; boundary="'
+
boundary
[
1
]
+
'"'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment