Skip to content

Commit 771e637

Browse files
committed
Fixes #10098. Avoid a slashy-starry char sequence in literal strings to evade faulty script compressors.
1 parent 84f2908 commit 771e637

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ajax.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ var r20 = /%20/g,
4242
ajaxLocation,
4343

4444
// Document location segments
45-
ajaxLocParts;
45+
ajaxLocParts,
46+
47+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
48+
starSlashStar = "*/".concat("*");
4649

4750
// #8138, IE may throw an exception when accessing
4851
// a field from window.location if document.domain has been set
@@ -331,7 +334,7 @@ jQuery.extend({
331334
html: "text/html",
332335
text: "text/plain",
333336
json: "application/json, text/javascript",
334-
"*": "*/*"
337+
"*": starSlashStar
335338
},
336339

337340
contents: {
@@ -702,7 +705,7 @@ jQuery.extend({
702705
jqXHR.setRequestHeader(
703706
"Accept",
704707
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
705-
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
708+
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + starSlashStar + "; q=0.01" : "" ) :
706709
s.accepts[ "*" ]
707710
);
708711

0 commit comments

Comments
 (0)