public string CanonicalizeHttpRequest(HttpWebRequest request, string accountName)
        {
            // Start with x-ms-date or Date
            string dateValue = request.Headers[Constants.HeaderConstants.Date];

            if (string.IsNullOrEmpty(dateValue))
            {
                dateValue = request.Headers[HttpRequestHeader.Date];
            }

            CanonicalizedString canonicalizedString = new CanonicalizedString(dateValue);

            // And we only need the canonicalized resource in addition to date
            canonicalizedString.AppendCanonicalizedElement(CanonicalizationHelper.GetCanonicalizedResourceForSharedKeyLite(request.Address, accountName));

            return(canonicalizedString.Value);
        }
Beispiel #2
0
        public string CanonicalizeHttpRequest(HttpRequestMessage request, string accountName)
        {
            // Start with x-ms-date or Date
            string dateValue = HttpResponseMessageUtils.GetHeaderSingleValueOrDefault(request.Headers, Constants.HeaderConstants.Date);

            if (string.IsNullOrEmpty(dateValue))
            {
                dateValue = CommonUtils.GetDateTimeValueOrDefault(request.Headers.Date);
            }

            CanonicalizedString canonicalizedString = new CanonicalizedString(dateValue);

            // And we only need the canonicalized resource in addition to date
            canonicalizedString.AppendCanonicalizedElement(CanonicalizationHelper.GetCanonicalizedResourceForSharedKeyLite(request.RequestUri, accountName));

            return(canonicalizedString.Value);
        }