VHostRedirectCondition.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace System.Net.ApiService.VHost_Server {
  5. public class VHostRedirectCondition {
  6. public enum eCondition : byte {
  7. Ignore = 0,
  8. Must = 1,
  9. MustNot = 2
  10. }
  11. public enum eVaraible : byte {
  12. Method,
  13. Path,
  14. Query,
  15. Referer,
  16. Host,
  17. UserAgent
  18. }
  19. public VHostRedirectCondition() {
  20. }
  21. public VHostRedirectCondition(eVaraible HeaderVariable, string pattern) {
  22. this.HeaderVariable = HeaderVariable;
  23. this.HeaderValue = pattern;
  24. this.ConditionType = eCondition.Must;
  25. this.Active = true;
  26. }
  27. public VHostRedirectCondition(eVaraible HeaderVariable, string pattern, eCondition ConditionType) {
  28. this.HeaderVariable = HeaderVariable;
  29. this.HeaderValue = pattern;
  30. this.ConditionType = ConditionType;
  31. this.Active = true;
  32. }
  33. public VHostRedirectCondition(eVaraible HeaderVariable, string pattern, eCondition ConditionType, bool IsActive) {
  34. this.HeaderVariable = HeaderVariable;
  35. this.HeaderValue = pattern;
  36. this.ConditionType = ConditionType;
  37. this.Active = IsActive;
  38. }
  39. /*public string Host { get; set; }
  40. public eCondition Host_Condition { get; set; }
  41. public string Referer { get; set; }
  42. public eCondition Referer_Condition { get; set; }
  43. public HttpMethod Method { get; set; }
  44. public eCondition Method_Condition { get; set; }
  45. public string Path { get; set; }
  46. public eCondition Path_Condition { get; set; }
  47. public RequestHeader.eEncoder Encoding { get; set; }
  48. public eCondition Encoding_Condition { get; set; }
  49. public string UserAgent { get; set; }
  50. public eCondition UserAgent_Condition { get; set; }
  51. public string QueryString { get; set; }
  52. public eCondition QueryString_Condition { get; set; }*/
  53. public eVaraible HeaderVariable { get; set; }
  54. public string HeaderValue { get; set; }
  55. public eCondition ConditionType { get; set; }
  56. public bool Active { get; set; }
  57. }
  58. }