Skip to content

Commit 979dd1c

Browse files
committed
Merge pull request jquery#473 from dmethvin/fix-10098-faux-comment
Fixes #10098. Avoid a slashy-starry char sequence to prevent T-Mobile (and other brain-damaged) script compression breaking jQuery.
2 parents db9e023 + 8cabdcd commit 979dd1c

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+
allTypes = ["*/"] + ["*"];
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+
"*": allTypes
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 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
706709
s.accepts[ "*" ]
707710
);
708711

0 commit comments

Comments
 (0)