⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 272642 in webkit


Ignore:
Timestamp:
Feb 10, 2021, 1:42:11 AM (6 years ago)
Author:
Carlos Garcia Campos
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:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272640 r272642  
     12021-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Some privateClickMeasurement might output the information in different order depending on platform
     4        https://bugs.webkit.org/show_bug.cgi?id=221406
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The script conversionReport.php iterates the HTTP headers to show the information, but header's order can be
     9        different for different platforms. We could just check every value we want to show to make sure we always
     10        provide them in the same order.
     11
     12        * http/tests/privateClickMeasurement/resources/conversionReport.php:
     13
    1142021-02-10  Rob Buis  <rbuis@igalia.com>
    215
  • trunk/LayoutTests/http/tests/privateClickMeasurement/resources/conversionReport.php

    r270136 r272642  
    55$httpHeaders = $_SERVER;
    66$cookiesFound = false;
    7 foreach ($httpHeaders as $name => $value) {
    8     if ($name === "HTTP_HOST") {
    9         fwrite($conversionFile, "$name: $value\n");
    10     } else if ($name === "REQUEST_URI") {
    11         $positionOfNonce = strpos($value, "?nonce=");
    12         if ($positionOfNonce === false)
    13             $outputURL = $value;
    14         else
    15             $outputURL = substr($value, 0, $positionOfNonce);
    16         fwrite($conversionFile, "$name: $outputURL\n");
    17     } else if ($name === "HTTP_COOKIE") {
    18         fwrite($conversionFile, "Cookies in attribution request: $value\n");
    19         $cookiesFound = true;
    20     } else if ($name === "CONTENT_TYPE") {
    21         fwrite($conversionFile, "Content type: $value\n");
    22     }
     7
     8if ($value = $httpHeaders["HTTP_HOST"]) {
     9    fwrite($conversionFile, "HTTP_HOST: $value\n");
    2310}
     11
     12if ($value = $httpHeaders["HTTP_COOKIE"]) {
     13    fwrite($conversionFile, "Cookies in attribution request: $value\n");
     14    $cookiesFound = true;
     15}
     16
     17if ($value = $httpHeaders["CONTENT_TYPE"]) {
     18    fwrite($conversionFile, "Content type: $value\n");
     19}
     20
     21if ($value = $httpHeaders["REQUEST_URI"]) {
     22    $value = $httpHeaders["REQUEST_URI"];
     23    $positionOfNonce = strpos($value, "?nonce=");
     24    if ($positionOfNonce === false)
     25        $outputURL = $value;
     26    else
     27        $outputURL = substr($value, 0, $positionOfNonce);
     28    fwrite($conversionFile, "REQUEST_URI: $outputURL\n");
     29}
     30
    2431if (!$cookiesFound) {
    2532    fwrite($conversionFile, "No cookies in attribution request.\n");
Note: See TracChangeset for help on using the changeset viewer.