This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
Fixed exception messages for server variable parsing #150
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,15 @@ namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite | |
{ | ||
public static class ServerVariables | ||
{ | ||
public static PatternSegment FindServerVariable(string serverVariable) | ||
public static PatternSegment FindServerVariable(string serverVariable, ParserContext context) | ||
{ | ||
switch (serverVariable) | ||
{ | ||
// TODO Add all server variables here. | ||
case "ALL_RAW": | ||
throw new NotSupportedException("Rules using the AUTH_TYPE server variable are not supported"); | ||
throw new NotSupportedException("Rules using the ALL_RAW server variable are not supported"); | ||
case "APP_POOL_ID": | ||
throw new NotSupportedException("Rules using the AUTH_TYPE server variable are not supported"); | ||
throw new NotSupportedException("Rules using the APP_POOL_ID server variable are not supported"); | ||
case "CONTENT_LENGTH": | ||
return new HeaderSegment(HeaderNames.ContentLength); | ||
case "CONTENT_TYPE": | ||
|
@@ -41,7 +41,7 @@ public static PatternSegment FindServerVariable(string serverVariable) | |
case "LOCAL_ADDR": | ||
return new LocalAddressSegment(); | ||
case "HTTP_PROXY_CONNECTION": | ||
throw new NotSupportedException("Rules using the AUTH_TYPE server variable are not supported"); | ||
throw new NotSupportedException("Rules using the HTTP_PROXY_CONNECTION server variable are not supported"); | ||
case "QUERY_STRING": | ||
return new QueryStringSegment(); | ||
case "REMOTE_ADDR": | ||
|
@@ -55,7 +55,7 @@ public static PatternSegment FindServerVariable(string serverVariable) | |
case "REQUEST_URI": | ||
return new UrlSegment(); | ||
default: | ||
throw new FormatException("Unrecognized server variable"); | ||
throw new FormatException(Resources.FormatError_InputParserUnrecognizedParameter(serverVariable, context.Index)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code has become inconsistent on strings vs resources. We should add an issue to clean this up. (You don't need to add to this PR.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I logged #153 |
||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add a message for this one