source: binary-improvements2/MapRendering/Web/Handlers/RewriteHandler.cs@ 387

Last change on this file since 387 was 387, checked in by alloc, 2 years ago

Big refactoring in Web to pass around a Context instead of a bunch of individual arguments all the time

File size: 540 bytes
Line 
1namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
2 public class RewriteHandler : AbsHandler {
3 private readonly string target;
4 private readonly bool fixedTarget;
5
6 public RewriteHandler (string _target, bool _fixedTarget = false) : base (null) {
7 target = _target;
8 fixedTarget = _fixedTarget;
9 }
10
11 public override void HandleRequest (RequestContext _context) {
12 _context.RequestPath = fixedTarget ? target : target + _context.RequestPath.Remove (0, urlBasePath.Length);
13 parent.ApplyPathHandler (_context);
14 }
15 }
16}
Note: See TracBrowser for help on using the repository browser.