-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Make 303 redirects do GET like Net Framework #49095
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
Changes from 7 commits
73c3f7f
8dafbc8
d5c8555
7adca75
2717413
66f59c4
98b4652
ca834c0
3ec922c
728a81f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,9 +142,10 @@ private static bool RequestRequiresForceGet(HttpStatusCode statusCode, HttpMetho | |
| { | ||
| case HttpStatusCode.Moved: | ||
| case HttpStatusCode.Found: | ||
| case HttpStatusCode.SeeOther: | ||
| case HttpStatusCode.MultipleChoices: | ||
| return requestMethod == HttpMethod.Post; | ||
| case HttpStatusCode.SeeOther: | ||
| return requestMethod != HttpMethod.Head; | ||
|
||
| default: | ||
| return false; | ||
| } | ||
|
|
||
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.
The one thing I'd add here is a completely custom method, e.g. "MYCUSTOMMETHOD" or whatever, and validate it gets changed to GET on 303.
Uh oh!
There was an error while loading. Please reload this page.
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 - first i verified that an incorrect test of
yield return new object[] { statusCode, "MYCUSTOMMETHOD", "MYCUSTOMMETHOD" };fails and then that the correct
yield return new object[] { statusCode, "MYCUSTOMMETHOD", statusCode == 303 ? "GET" : "MYCUSTOMMETHOD" };passes
(I like breaking tests so I can tell I did something when I make them work)