Exemple #1
0
        public void SetHeaders(HeaderList AHeaders)
        {
            string S = "";

            if (_Authentication != null)
            {
                S = _Authentication.Authentication();
                if (S.Length > 0)
                {
                    AHeaders.Values("Proxy-Authentication", S);
                }
            }
            else
            {
                if (_BasicByDefault)
                {
                    _Authentication          = new BasicAuthentication();
                    _Authentication.UserName = _UserName;
                    _Authentication.Password = _Password;
                    S = _Authentication.Authentication();
                    if (S.Length > 0)
                    {
                        AHeaders.Values("Proxy-Authentication", S);
                    }
                }
            }
        }
		public void SetHeaders(HeaderList AHeaders) {
			string S = "";
			if (_Authentication != null) {
				S = _Authentication.Authentication();
				if (S.Length > 0) {
					AHeaders.Values("Proxy-Authentication", S);
				}
			} else {
				if (_BasicByDefault) {
					_Authentication = new BasicAuthentication();
					_Authentication.UserName = _UserName;
					_Authentication.Password = _Password;
					S = _Authentication.Authentication();
					if (S.Length > 0) {
						AHeaders.Values("Proxy-Authentication", S);
					}
				}
			}
		}
 protected string GetPassword()
 {
     return(_Params.Values("password"));
 }
		protected virtual void DoProcessHeaders() {
			int LSecs;
			_Connection = _RawHeaders.Values("Connection");
			_ContentVersion = _RawHeaders.Values("Content-Version");
			_ContentEncoding = _RawHeaders.Values("Content-Encoding");
			_ContentLanguage = _RawHeaders.Values("Content-Language");
			_ContentType = _RawHeaders.Values("Content-Type");
			_ContentLength = Genetibase.Network.Sockets.Global.StrToInt32Def(_RawHeaders.Values("Content-Length").Trim(), -1);
			_HasContentLength = _ContentLength > 0;
			_Date = Http.GmtToLocalDateTime(_RawHeaders.Values("Date"));
			_LastModified = Http.GmtToLocalDateTime(_RawHeaders.Values("Last-Modified"));
            
			if (Genetibase.Network.Sockets.Global.StrToInt32Def(_RawHeaders.Values("Expires"), -1) != -1) {
				LSecs = Int32.Parse(_RawHeaders.Values("Expires"));
				_Expires = DateTime.Now.AddSeconds(LSecs);
			} else {
				_Expires = Http.GmtToLocalDateTime(_RawHeaders.Values("Expires"));
			}
			_Pragma = _RawHeaders.Values("Pragma");
		}