Last change
on this file since 383 was 382, checked in by alloc, 2 years ago |
Switched to use SpaceWizards.HttpListener
|
File size:
824 bytes
|
Line | |
---|
1 | using HttpListenerRequest = SpaceWizards.HttpListener.HttpListenerRequest;
|
---|
2 | using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
|
---|
3 |
|
---|
4 | namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
|
---|
5 | public class RewriteHandler : AbsHandler {
|
---|
6 | private readonly string target;
|
---|
7 | private readonly bool fixedTarget;
|
---|
8 |
|
---|
9 | public RewriteHandler (string _target, bool _fixedTarget = false) : base (null) {
|
---|
10 | target = _target;
|
---|
11 | fixedTarget = _fixedTarget;
|
---|
12 | }
|
---|
13 |
|
---|
14 | public override void HandleRequest (string _requestPath, HttpListenerRequest _req, HttpListenerResponse _resp, WebConnection _con,
|
---|
15 | int _permissionLevel) {
|
---|
16 | string newRequestPath = fixedTarget ? target : target + _requestPath.Remove (0, urlBasePath.Length);
|
---|
17 | parent.ApplyPathHandler (newRequestPath, _req, _resp, _con, _permissionLevel);
|
---|
18 | }
|
---|
19 | }
|
---|
20 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.