/// <summary>
        /// Spoof HTTP request information for signing/verification purposes.
        /// </summary>
        /// <param name="message">The message to add a pretend HTTP method to.</param>
        /// <returns>A spoofed HttpRequestInfo that wraps the new message.</returns>
        private CoordinatingHttpRequestInfo SpoofHttpMethod(IDirectedProtocolMessage message)
        {
            var signedMessage = message as ITamperResistantOAuthMessage;

            if (signedMessage != null)
            {
                string httpMethod = GetHttpMethod(signedMessage.HttpMethods);
                signedMessage.HttpMethod = httpMethod;
            }

            var requestInfo = new CoordinatingHttpRequestInfo(this.CloneSerializedParts(message), message.HttpMethods);

            return(requestInfo);
        }
コード例 #2
0
        protected internal override HttpRequestBase GetRequestFromContext()
        {
            MessageReceivingEndpoint recipient;
            WebHeaderCollection      headers;
            var messageData = this.AwaitIncomingMessage(out recipient, out headers);
            CoordinatingHttpRequestInfo result;

            if (messageData != null)
            {
                result = new CoordinatingHttpRequestInfo(this, this.MessageFactory, messageData, recipient, this.cookies);
            }
            else
            {
                result = new CoordinatingHttpRequestInfo(recipient, this.cookies);
            }

            if (headers != null)
            {
                headers.ApplyTo(result.Headers);
            }

            return(result);
        }