-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/godfisk 586/redirect module handle url with slash in the end #21
base: develop
Are you sure you want to change the base?
Conversation
…lash_in_the_end' into develop
@@ -462,9 +447,9 @@ | |||
<WebProjectProperties> | |||
<UseIIS>True</UseIIS> | |||
<AutoAssignPort>True</AutoAssignPort> | |||
<DevelopmentServerPort>0</DevelopmentServerPort> | |||
<DevelopmentServerPort>51181</DevelopmentServerPort> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Roman982 please move the settings outside the project (to .user file)
@@ -23,6 +25,14 @@ public CustomRedirect(string oldUrl, string newUrl, bool appendMatchToNewUrl, bo | |||
|
|||
} | |||
|
|||
public CustomRedirect(CustomRedirect redirect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state and notFoundErrorCount are missed in the copy ctor
@@ -23,6 +25,16 @@ public CustomRedirect(string oldUrl, string newUrl, bool appendMatchToNewUrl, bo | |||
|
|||
} | |||
|
|||
public CustomRedirect(CustomRedirect redirect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks strange that "copy" stor has differnt logic with Copy method, I think it would be better to have two differrent methods with corresponding names instead.
public string OldUrl { get; set; } | ||
public string OldUrl | ||
{ | ||
get => UrlStandardizer.Standardize(_oldUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks strange that UrlStandardizer.Standardize method used for both get and set.
[TestCase("http://www.website.com/test/x1", "/sjomatskolen/x1")] | ||
[TestCase("http://www.website.com/test/x2/", "/sjomatskolen/x2")] | ||
[TestCase("http://www.website.com/test/x3/?a=b", "/sjomatskolen/x3?a=b")] | ||
public void the_original_redirect_newurl_remains_unchanged(string url, string expectedRedirect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected redirect is not used
|
||
context[$"Given the redirect rule is http://mysite/test => http://mysite, exactMatch={exactMatch}"] = () => | ||
{ | ||
before = () => redirects = new CustomRedirectCollection { new CustomRedirect("http://mysite/test", "http://mysite", appendMatchToNewUrl, exactMatch, true) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have the last parameter name here
|
||
context[$"Given the redirect rule is http://mysite/test => http://mysite, exactNatch={exactMatch}, appendMatchToNewUrl={appendMatchToNewUrl}"] = () => | ||
{ | ||
before = () => redirects = new CustomRedirectCollection { new CustomRedirect("http://mysite/test", "http://mysite", appendMatchToNewUrl, exactMatch, true) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be nice to test case when new ULR has / at the end (http://mysite/)
fixes #13
The essence of the change is in the following tests: