private void SendingRequestEventHandlerScriptsVerifier(object sender, SendingRequestEventArgs e)
        {
            if (e.IsHttpRequest())
            {
                if (e.HttpRequest.RequestUri.OriginalString.Contains(Paths.StoredProceduresPathSegment))
                {
                    // Stored procedure execute validation should verify that the session token does exist.
                    if (e.HttpRequest.Method == HttpMethod.Post &&
                        !e.HttpRequest.RequestUri.OriginalString.EndsWith(Paths.StoredProceduresPathSegment))
                    {
                        Assert.IsTrue(e.HttpRequest.Headers.Contains(HttpConstants.HttpHeaders.SessionToken));
                        return;
                    }

                    Assert.IsFalse(e.HttpRequest.Headers.Contains(Microsoft.Azure.Documents.HttpConstants.HttpHeaders.SessionToken));
                }
            }
        }
Exemple #2
0
 private void SendingRequestEventHandler(object sender, SendingRequestEventArgs e)
 {
     Assert.IsFalse(e.IsHttpRequest());
     e.DocumentServiceRequest.Headers.Add(newHeaderKey, newHeaderValue);
 }