Example #1
0
 public RequestHandler(Docs documentation, WebServerDelegate callback)
 {
     this.Callback      = callback;
     this.Documentation = documentation;
     try
     {
         this.MethodRegex   = new Regex(Documentation.method, RegexOptions.Compiled | RegexOptions.IgnoreCase);
         this.ResourceRegex = new Regex(parsePatternText(Documentation.requestPattern), RegexOptions.Compiled | RegexOptions.IgnoreCase);
     }
     catch (Exception ex)
     {
         throw new HttpException(HttpStatusCode.InternalServerError, "Unable to parse the docs for {0}. {1}", Documentation.name, ex.Message);
     }
 }
Example #2
0
 public RequestHandler(Docs documentation, WebServerDelegate callback)
 {
     this.Callback = callback;
     this.Documentation = documentation;
     try
     {
         this.MethodRegex = new Regex(Documentation.method, RegexOptions.Compiled | RegexOptions.IgnoreCase);
         this.ResourceRegex = new Regex(parsePatternText(Documentation.requestPattern), RegexOptions.Compiled | RegexOptions.IgnoreCase);
     }
     catch (Exception ex)
     {
         throw new HttpException(HttpStatusCode.InternalServerError, "Unable to parse the docs for {0}. {1}", Documentation.name, ex.Message);
     }
 }