-
Notifications
You must be signed in to change notification settings - Fork 523
Implement IHttpRequestFeature.RawTarget (aspnet/HttpAbstractions#596) #880
Conversation
@@ -204,6 +205,58 @@ public void RequestPathIsNormalized() | |||
} | |||
} | |||
|
|||
[Theory] | |||
[InlineData("/")] |
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.
*
?
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.
Done in another test.
👍 |
Added test for paths not starting with |
bc35a05
to
15aea76
Compare
[InlineData("*")] | ||
[InlineData("DoesNotStartWith/")] | ||
[InlineData("*?arg=value")] | ||
[InlineData("*/?arg=value")] |
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.
[InlineData("%2F")]
?
85762c2
to
d2095c0
Compare
Checked in some unintended changes, reverting. |
d2095c0
to
52980f6
Compare
Updated with a small perf detail. |
Squirrel? |
🔔 I'd like to merge this tonight. |
Would it be so bad to merge tomorrow? The build's broken. |
b4fa841
to
efa1890
Compare
Squashed. |
This make only the second usage of |
response.Append(Encoding.ASCII.GetString(buffer, 0, length)); | ||
} | ||
|
||
Assert.StartsWith("HTTP/1.1 200 OK", response.ToString()); |
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.
Testing only StartsWith
seems wrong. In most of our tests, we verify the entire response is what we expect.
@halter73 Removed |
🔔 |
[InlineData(".././")] | ||
[InlineData("../..")] | ||
[InlineData("../../")] | ||
public async Task NonPathRequestTargetSetInRawTarget(string requestTarget) |
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.
Would these test cases pass with WebListenter after you add RawTarget there? I mainly wondering whether Path, PathBase and QueryString would all be an empty string.
Should this be added to ServerTests?
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.
WebListener actually rejects those requests. Maybe we should do the same in Kestrel? The only request I was able to make to a target not starting with /
was OPTIONS *
.
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.
Also, WebListener turned *
into /*
in Path
.
8bb2b85
to
1bf2f6b
Compare
|
else | ||
{ | ||
rawTarget = pathBegin.GetAsciiString(queryEnd); | ||
} | ||
} | ||
|
||
requestUrlPath = PathNormalizer.RemoveDotSegments(requestUrlPath); |
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.
New variable please.
7f2aaac
to
50208a3
Compare
aspnet/HttpAbstractions#596
Needs aspnet/HttpAbstractions#639 to be merged to work.
cc @halter73 @mikeharder @Tratcher @davidfowl