-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RedirectResult for AspNetCore 2.2. Fixes #3986
- Loading branch information
Showing
4 changed files
with
44 additions
and
5 deletions.
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
16 changes: 16 additions & 0 deletions
16
test/WebJobs.Script.Tests.Integration/TestScripts/CSharp/HttpTrigger-Redirect/function.json
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"type": "httpTrigger", | ||
"name": "req", | ||
"direction": "in", | ||
"methods": [ "get" ], | ||
"authLevel": "anonymous" | ||
}, | ||
{ | ||
"type": "http", | ||
"name": "$return", | ||
"direction": "out" | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
test/WebJobs.Script.Tests.Integration/TestScripts/CSharp/HttpTrigger-Redirect/run.csx
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#r "Newtonsoft.Json" | ||
|
||
using System.Net; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Primitives; | ||
using Newtonsoft.Json; | ||
|
||
public static async Task<IActionResult> Run(HttpRequest req, ILogger log) | ||
{ | ||
return new RedirectResult("http://bing.com"); | ||
} |
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
986f6fe
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.
HomepageMiddleware.cs also incorrectly calls the default constructor for ActionContext.
I don't know how ActionContext changed from 2.1, but the default constructor is not safe anymore.