// This copy constructor is used by the granular request validation feature. Since these collections are immutable
        // once created, it's ok for us to have two collections containing the same data.
        internal HttpHeaderCollection(HttpHeaderCollection col)
            : base(col) {

            _request = col._request;
            _response = col._response;
            _iis7WorkerRequest = col._iis7WorkerRequest;
        }
Esempio n. 2
0
 // This copy constructor is used by the granular request validation feature. Since these collections are immutable
 // once created, it's ok for us to have two collections containing the same data.
 internal HttpHeaderCollection(HttpHeaderCollection col)
     : base(col)
 {
     _request           = col._request;
     _response          = col._response;
     _iis7WorkerRequest = col._iis7WorkerRequest;
 }
Esempio n. 3
0
 private void SynchronizeHeader(string name, string value)
 {
     if (StringUtil.StringStartsWith(name, "HTTP_"))
     {
         string header = name.Substring("HTTP_".Length).Replace('_', '-');
         int    knownRequestHeaderIndex = HttpWorkerRequest.GetKnownRequestHeaderIndex(header);
         if (knownRequestHeaderIndex > -1)
         {
             header = HttpWorkerRequest.GetKnownRequestHeaderName(knownRequestHeaderIndex);
         }
         HttpHeaderCollection headers = this._request.Headers as HttpHeaderCollection;
         if (headers != null)
         {
             headers.SynchronizeHeader(header, value);
         }
     }
 }
        private void SynchronizeHeader(String name, String value)
        {
            if (StringUtil.StringStartsWith(name, "HTTP_"))
            {
                // update managed copy of header
                string headerName = name.Substring("HTTP_".Length);
                headerName = headerName.Replace('_', '-');
                int knownIndex = HttpWorkerRequest.GetKnownRequestHeaderIndex(headerName);
                if (knownIndex > -1)
                {
                    headerName = HttpWorkerRequest.GetKnownRequestHeaderName(knownIndex);
                }

                HttpHeaderCollection headers = _request.Headers as HttpHeaderCollection;
                if (headers != null)
                {
                    headers.SynchronizeHeader(headerName, value);
                }
            }
        }
Esempio n. 5
0
        // Populates the Headers property but does not hook up validation.
        internal HttpHeaderCollection EnsureHeaders() {
            if (_headers == null) {
                _headers = new HttpHeaderCollection(_wr, this, 8);

                if (_wr != null)
                    FillInHeadersCollection();

                if (!(_wr is IIS7WorkerRequest)) {
                    _headers.MakeReadOnly();
                }
            }

            return _headers;
        }