source: binary-improvements2/WebServer/src/UrlHandlers/RewriteHandler.cs@ 391

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

Major refactoring/cleanup

File size: 514 bytes
RevLine 
[391]1namespace Webserver.UrlHandlers {
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.