コード例 #1
0
        private void WriteStatus(Http2Stream stream, int statusCode, bool final)
        {
            var headers = new HeadersList
            {
                new KeyValuePair <string, string>(":status", statusCode.ToString()),
            };

            stream.WriteHeadersFrame(headers, final);
        }
コード例 #2
0
        /// <summary>
        /// Writes the status header to the stream.
        /// </summary>
        /// <param name="final">if set to <c>true</c> then marks headers frame as final.</param>
        private void SendHeaders(bool final)
        {
            var responseHeaders = new HeadersList(_responseHeaders)
            {
                new KeyValuePair <string, string>(CommonHeaders.Status, _owinContext.Response.StatusCode.ToString(CultureInfo.InvariantCulture))
            };

            _protocolStream.WriteHeadersFrame(responseHeaders, final, true);
        }
コード例 #3
0
        /// <summary>
        /// Writes the status header to the stream.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="statusCode">The status code.</param>
        /// <param name="final">if set to <c>true</c> then marks headers frame as final.</param>
        /// <param name="headers">Additional headers</param>
        private void WriteStatus(Http2Stream stream, int statusCode, bool final, HeadersList headers = null)
        {
            if (headers == null)
            {
                headers = new HeadersList();
            }
            headers.Add(new KeyValuePair <string, string>(CommonHeaders.Status, statusCode.ToString(CultureInfo.InvariantCulture)));

            stream.WriteHeadersFrame(headers, final, true);
        }