Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Conversation

@jkotalik
Copy link

@jkotalik jkotalik commented Jul 6, 2016

Barebones implementation of mod_rewrite. Can handle only simple replacement rules for now. Majority of the work remains in implementing the flags, which provide the power to do redirects, different portions of the context, etc.
This is here mostly for a review tomorrow, but feel free to comment on major aspects (we'll handle nits once we are much closer to pushing this).

@Tratcher @muratg @victorhurdugaci @davidfowl @DamianEdwards

@dnfclas
Copy link

dnfclas commented Jul 6, 2016

Hi @ZestyBread, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@victorhurdugaci
Copy link
Contributor

Shouldn't this be in BasicMiddleware?

@@ -0,0 +1,15 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright (on all files, no just this one)

public static class RewriteConfigurationExtensions
{

public static List<Rule> AddRewriteFile(string path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is called extensions but this is not an extension method

@victorhurdugaci
Copy link
Contributor

{
public List<ConditionTestStringSegment> TestStringSegments { get; }
public GeneralExpression ConditionRegex { get; }
public List<string> Flags { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice but List is still mutable. Make it IEnumerable

public Operand Operand { get; set; }
public bool Invert { get; set; }

public bool VisitConditionExpression(HttpContext context, Match results, Match previous, string concatTestString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be a method on the expression. the visitor with all the methods is a separate class. The base visitor has has all the methods virtual and they simply go throught the graph. That way, you can implement your own visitor by overiding parts of the original visitor without having the implement everything and it also allows you to stop the visitor if you don't need to visit the child of one node

@jkotalik
Copy link
Author

Moving this to Basic Middleware!

@jkotalik jkotalik closed this Jul 15, 2016
@jkotalik jkotalik deleted the urlRewrite branch August 15, 2017 23:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.