29 using System.Collections.Generic;
31 using System.Text.RegularExpressions;
33 namespace OpenSim.Framework.Servers.HttpServer
77 public virtual Regex Method
79 get {
return _method; }
89 public virtual Regex Path
99 public virtual Dictionary<string, Regex> Query
101 get {
return _query; }
103 protected Dictionary<string, Regex>
_query;
109 public virtual Dictionary<string, Regex> Headers
111 get {
return _headers; }
124 public virtual Regex IPEndPointWhitelist
126 get {
return _ipEndPointRegex; }
140 public OSHttpHandler(Regex method, Regex path, Dictionary<string, Regex> query,
141 Dictionary<string, Regex> headers, Regex contentType, Regex whitelist)
146 _ipEndPointRegex = whitelist;
148 if (null == _headers && null != contentType)
150 _headers =
new Dictionary<string, Regex>();
151 _headers.Add(
"content-type", contentType);
169 StringWriter sw =
new StringWriter();
170 sw.WriteLine(
"{0}", base.ToString());
171 sw.WriteLine(
" method regex {0}", null == Method ?
"null" : Method.ToString());
172 sw.WriteLine(
" path regex {0}", null == Path ?
"null": Path.ToString());
173 foreach (
string tag
in Headers.Keys)
175 sw.WriteLine(
" header {0} : {1}", tag, Headers[tag].ToString());
177 sw.WriteLine(
" IP whitelist {0}", null == IPEndPointWhitelist ?
"null" : IPEndPointWhitelist.ToString());
180 return sw.ToString();
override string ToString()
delegate bool OSHttpContentTypeChecker(OSHttpRequest req)
An OSHttpHandler that matches on the "content-type" header can supply an OSHttpContentTypeChecker del...
Dictionary< string, Regex > _query
OSHttpHandler(Regex method, Regex path, Dictionary< string, Regex > query, Dictionary< string, Regex > headers, Regex contentType, Regex whitelist)
Base class constructor.
Dictionary< string, Regex > _headers