diff options
author | Dr Scofield | 2008-07-07 11:25:09 +0000 |
---|---|---|
committer | Dr Scofield | 2008-07-07 11:25:09 +0000 |
commit | aaf8fff57e85a8f164c4ab27c5e126e91a81027f (patch) | |
tree | 37b82469367fbf071a4bd61841125a617ac26c2f /OpenSim/Framework | |
parent | added a hollow size constraint to box, cylinder, and prism prim meshes to pre... (diff) | |
download | opensim-SC-aaf8fff57e85a8f164c4ab27c5e126e91a81027f.zip opensim-SC-aaf8fff57e85a8f164c4ab27c5e126e91a81027f.tar.gz opensim-SC-aaf8fff57e85a8f164c4ab27c5e126e91a81027f.tar.bz2 opensim-SC-aaf8fff57e85a8f164c4ab27c5e126e91a81027f.tar.xz |
adding support for IP EndPoint whitelisting in HttpServer code.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpRequest.cs | 23 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpRequestPump.cs | 11 |
2 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/OSHttpRequest.cs b/OpenSim/Framework/Servers/OSHttpRequest.cs index f8f542b..c523143 100644 --- a/OpenSim/Framework/Servers/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/OSHttpRequest.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Framework.Servers | |||
56 | private Uri _url; | 56 | private Uri _url; |
57 | private NameValueCollection _queryString; | 57 | private NameValueCollection _queryString; |
58 | private string _userAgent; | 58 | private string _userAgent; |
59 | private IPEndPoint _ipEndPoint; | ||
59 | 60 | ||
60 | private HttpRequest _request; | 61 | private HttpRequest _request; |
61 | // private HttpClientContext _context; | 62 | // private HttpClientContext _context; |
@@ -146,6 +147,11 @@ namespace OpenSim.Framework.Servers | |||
146 | get { return _queryString; } | 147 | get { return _queryString; } |
147 | } | 148 | } |
148 | 149 | ||
150 | public IPEndPoint RemoteIPEndPoint | ||
151 | { | ||
152 | get { return _ipEndPoint; } | ||
153 | } | ||
154 | |||
149 | public HttpRequest HttpRequest | 155 | public HttpRequest HttpRequest |
150 | { | 156 | { |
151 | get { return _request; } | 157 | get { return _request; } |
@@ -161,18 +167,20 @@ namespace OpenSim.Framework.Servers | |||
161 | _contentEncoding = req.ContentEncoding; | 167 | _contentEncoding = req.ContentEncoding; |
162 | _contentLength64 = req.ContentLength64; | 168 | _contentLength64 = req.ContentLength64; |
163 | _contentType = req.ContentType; | 169 | _contentType = req.ContentType; |
164 | // _cookies = req.Cookies; | ||
165 | _headers = req.Headers; | 170 | _headers = req.Headers; |
166 | _httpMethod = req.HttpMethod; | 171 | _httpMethod = req.HttpMethod; |
167 | _hasbody = req.HasEntityBody; | 172 | _hasbody = req.HasEntityBody; |
168 | _inputStream = req.InputStream; | 173 | _inputStream = req.InputStream; |
169 | // _isSecureConnection = req.IsSecureConnection; | ||
170 | // _isAuthenticated = req.IsAuthenticated; | ||
171 | _keepAlive = req.KeepAlive; | 174 | _keepAlive = req.KeepAlive; |
172 | _rawUrl = req.RawUrl; | 175 | _rawUrl = req.RawUrl; |
173 | _url = req.Url; | 176 | _url = req.Url; |
174 | _queryString = req.QueryString; | 177 | _queryString = req.QueryString; |
175 | _userAgent = req.UserAgent; | 178 | _userAgent = req.UserAgent; |
179 | _ipEndPoint = req.RemoteEndPoint; | ||
180 | |||
181 | // _cookies = req.Cookies; | ||
182 | // _isSecureConnection = req.IsSecureConnection; | ||
183 | // _isAuthenticated = req.IsAuthenticated; | ||
176 | } | 184 | } |
177 | 185 | ||
178 | public OSHttpRequest(HttpClientContext context, HttpRequest req) | 186 | public OSHttpRequest(HttpClientContext context, HttpRequest req) |
@@ -186,13 +194,10 @@ namespace OpenSim.Framework.Servers | |||
186 | _contentLength64 = req.ContentLength; | 194 | _contentLength64 = req.ContentLength; |
187 | if (null != req.Headers["content-type"]) | 195 | if (null != req.Headers["content-type"]) |
188 | _contentType = _request.Headers["content-type"]; | 196 | _contentType = _request.Headers["content-type"]; |
189 | // _cookies = req.Cookies; | ||
190 | _headers = req.Headers; | 197 | _headers = req.Headers; |
191 | _httpMethod = req.Method; | 198 | _httpMethod = req.Method; |
192 | _hasbody = req.ContentLength != 0; | 199 | _hasbody = req.ContentLength != 0; |
193 | _inputStream = req.Body; | 200 | _inputStream = req.Body; |
194 | // _isSecureConnection = req.IsSecureConnection; | ||
195 | // _isAuthenticated = req.IsAuthenticated; | ||
196 | _keepAlive = ConnectionType.KeepAlive == req.Connection; | 201 | _keepAlive = ConnectionType.KeepAlive == req.Connection; |
197 | _rawUrl = req.Uri.AbsolutePath; | 202 | _rawUrl = req.Uri.AbsolutePath; |
198 | _url = req.Uri; | 203 | _url = req.Uri; |
@@ -203,6 +208,12 @@ namespace OpenSim.Framework.Servers | |||
203 | { | 208 | { |
204 | _queryString.Add(q.Key, q.Value.Value); | 209 | _queryString.Add(q.Key, q.Value.Value); |
205 | } | 210 | } |
211 | // TODO: requires change to HttpServer.HttpRequest | ||
212 | _ipEndPoint = null; | ||
213 | |||
214 | // _cookies = req.Cookies; | ||
215 | // _isSecureConnection = req.IsSecureConnection; | ||
216 | // _isAuthenticated = req.IsAuthenticated; | ||
206 | } | 217 | } |
207 | } | 218 | } |
208 | } | 219 | } |
diff --git a/OpenSim/Framework/Servers/OSHttpRequestPump.cs b/OpenSim/Framework/Servers/OSHttpRequestPump.cs index b76fadc..4218be5 100644 --- a/OpenSim/Framework/Servers/OSHttpRequestPump.cs +++ b/OpenSim/Framework/Servers/OSHttpRequestPump.cs | |||
@@ -165,11 +165,14 @@ namespace OpenSim.Framework.Servers | |||
165 | if (null != endPointsRegex) | 165 | if (null != endPointsRegex) |
166 | { | 166 | { |
167 | // TODO: following code requires code changes to | 167 | // TODO: following code requires code changes to |
168 | // HttpServer.HttpRequest | 168 | // HttpServer.HttpRequest to become functional |
169 | 169 | ||
170 | // IPEndPoint remote = HttpServer.HttpRequest.RemoteIPEndPoint; | 170 | IPEndPoint remote = req.RemoteIPEndPoint; |
171 | // Match epm = endPointsRegex.Match(remote.ToString()); | 171 | if (null != remote) |
172 | // if (!epm.Success) continue; | 172 | { |
173 | Match epm = endPointsRegex.Match(remote.ToString()); | ||
174 | if (!epm.Success) continue; | ||
175 | } | ||
173 | } | 176 | } |
174 | 177 | ||
175 | // whitelist ok, now check path | 178 | // whitelist ok, now check path |