Bug 1249474. Part 2 - Update tests to handle new default image Accept header value. r=mcmanus

This commit is contained in:
Mike Taylor 2016-02-26 19:55:29 -06:00
parent 8417788579
commit 67e3fade30
3 changed files with 6 additions and 5 deletions

View File

@ -9,7 +9,7 @@ function handleRequest(request, response)
file.append("test");
file.append("mochitest");
if (request.getHeader("Accept") == "image/png,image/*;q=0.8,*/*;q=0.5") {
if (request.getHeader("Accept") == "*/*") {
file.append('blue.png');
} else {
file.append('red.png');

View File

@ -1,10 +1,11 @@
<!DOCTYPE html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=398066
https://bugzilla.mozilla.org/show_bug.cgi?id=398066.
https://bugzilla.mozilla.org/show_bug.cgi?id=1249474.
-->
<html>
<head>
<title>Accept: header should include image/* catchall</title>
<title>Accept: header should include */* catchall</title>
</head>
<body>
<img src="check-header.sjs">

View File

@ -2,8 +2,8 @@ const BinaryOutputStream = Components.Constructor("@mozilla.org/binaryoutputstre
function isCatchall(v)
{
// "image/*" item exactly or with a quality factor
return /^image\/\*(?:|;q=(?:1(?:\.0{0,3})?|0(?:\.\d{0,3})?))$/.test(v);
// "*/*" exactly
return /^\*\/\*$/.test(v);
}
/*