Title: [272642] trunk/LayoutTests
Revision
272642
Author
carlo...@webkit.org
Date
2021-02-10 01:42:11 -0800 (Wed, 10 Feb 2021)

Log Message

Some privateClickMeasurement might output the information in different order depending on platform
https://bugs.webkit.org/show_bug.cgi?id=221406

Reviewed by Michael Catanzaro.

The script conversionReport.php iterates the HTTP headers to show the information, but header's order can be
different for different platforms. We could just check every value we want to show to make sure we always
provide them in the same order.

* http/tests/privateClickMeasurement/resources/conversionReport.php:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (272641 => 272642)


--- trunk/LayoutTests/ChangeLog	2021-02-10 09:41:17 UTC (rev 272641)
+++ trunk/LayoutTests/ChangeLog	2021-02-10 09:42:11 UTC (rev 272642)
@@ -1,3 +1,16 @@
+2021-02-10  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        Some privateClickMeasurement might output the information in different order depending on platform
+        https://bugs.webkit.org/show_bug.cgi?id=221406
+
+        Reviewed by Michael Catanzaro.
+
+        The script conversionReport.php iterates the HTTP headers to show the information, but header's order can be
+        different for different platforms. We could just check every value we want to show to make sure we always
+        provide them in the same order.
+
+        * http/tests/privateClickMeasurement/resources/conversionReport.php:
+
 2021-02-10  Rob Buis  <rb...@igalia.com>
 
         Do not schedule update on embed creation

Modified: trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php (272641 => 272642)


--- trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php	2021-02-10 09:41:17 UTC (rev 272641)
+++ trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php	2021-02-10 09:42:11 UTC (rev 272642)
@@ -4,23 +4,30 @@
 $conversionFile = fopen($conversionFilePath . ".tmp", 'w');
 $httpHeaders = $_SERVER;
 $cookiesFound = false;
-foreach ($httpHeaders as $name => $value) {
-    if ($name === "HTTP_HOST") {
-        fwrite($conversionFile, "$name: $value\n");
-    } else if ($name === "REQUEST_URI") {
-        $positionOfNonce = strpos($value, "?nonce=");
-        if ($positionOfNonce === false)
-            $outputURL = $value;
-        else
-            $outputURL = substr($value, 0, $positionOfNonce);
-        fwrite($conversionFile, "$name: $outputURL\n");
-    } else if ($name === "HTTP_COOKIE") {
-        fwrite($conversionFile, "Cookies in attribution request: $value\n");
-        $cookiesFound = true;
-    } else if ($name === "CONTENT_TYPE") {
-        fwrite($conversionFile, "Content type: $value\n");
-    }
+
+if ($value = $httpHeaders["HTTP_HOST"]) {
+    fwrite($conversionFile, "HTTP_HOST: $value\n");
 }
+
+if ($value = $httpHeaders["HTTP_COOKIE"]) {
+    fwrite($conversionFile, "Cookies in attribution request: $value\n");
+    $cookiesFound = true;
+}
+
+if ($value = $httpHeaders["CONTENT_TYPE"]) {
+    fwrite($conversionFile, "Content type: $value\n");
+}
+
+if ($value = $httpHeaders["REQUEST_URI"]) {
+    $value = $httpHeaders["REQUEST_URI"];
+    $positionOfNonce = strpos($value, "?nonce=");
+    if ($positionOfNonce === false)
+        $outputURL = $value;
+    else
+        $outputURL = substr($value, 0, $positionOfNonce);
+    fwrite($conversionFile, "REQUEST_URI: $outputURL\n");
+}
+
 if (!$cookiesFound) {
     fwrite($conversionFile, "No cookies in attribution request.\n");
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to