Skip to content

Commit

Permalink
Do not send QT (queue time) with SC (session control) as Measurement …
Browse files Browse the repository at this point in the history
…Protocol gets confused.
  • Loading branch information
damieng committed Mar 9, 2014
1 parent 0ebcb5e commit 03bbc10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ public void MeasurementAnalyticsClient_AdjustUriBeforeRequest_Adds_Qt_Parameter(
StringAssert.Contains(actual.Query, "qt=");
}

[TestMethod]
public void MeasurementAnalyticsClient_AdjustUriBeforeRequest_Does_Not_Add_Qt_Parameter_If_Sc_Parameter_Present()
{
var originalUri = new Uri("http://anything.really.com/something?sc=start#" + DateTime.UtcNow.ToString("o"));

var actual = new MeasurementAnalyticsClient().AdjustUriBeforeRequest(originalUri);

Assert.IsFalse(actual.Query.Contains("qt="));
}

[TestMethod]
public void MeasurementAnalyticsClient_AdjustUriBeforeRequest_Clears_Fragment()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public Uri AdjustUriBeforeRequest(Uri uri)
/// <param name="parameters">URI parameters to add the relative QT parameter to.</param>
private static void AddQueueTimeFromFragment(Uri uri, IDictionary<string, string> parameters)
{
if (String.IsNullOrWhiteSpace(uri.Fragment)) return;
if (String.IsNullOrWhiteSpace(uri.Fragment) || parameters.ContainsKey("sc")) return;
var decodedFragment = uri.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);

DateTime utcHitTime;
Expand Down

1 comment on commit 03bbc10

@11RS
Copy link

@11RS 11RS commented on 03bbc10 Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.