-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When intercepting default IContentLoader we need to make sure to fall back to it in some cases but without the risk of running into an infinite loop. The default implementation should be passed in the constructor to the wrapper, named `defaultContentLoader` so that it's clear it will not go through the interceptor once again. Closes #255
- Loading branch information
1 parent
3724038
commit 67224d1
Showing
64 changed files
with
3,080 additions
and
3,099 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
29 changes: 29 additions & 0 deletions
29
src/Advanced.CMS.AdvancedReviews/AdvancedReviewsEndpointRoutingExtension.cs
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,29 @@ | ||
using Advanced.CMS.ExternalReviews; | ||
using EPiServer.ServiceLocation; | ||
using EPiServer.Web.Routing; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Routing; | ||
using Microsoft.AspNetCore.Routing.Constraints; | ||
|
||
namespace Advanced.CMS.AdvancedReviews; | ||
|
||
internal class AdvancedReviewsEndpointRoutingExtension : IEndpointRoutingExtension | ||
{ | ||
public void MapEndpoints(IEndpointRouteBuilder endpointRouteBuilder) | ||
{ | ||
var options = endpointRouteBuilder.ServiceProvider.GetInstance<ExternalReviewOptions>(); | ||
|
||
endpointRouteBuilder.MapControllerRoute("ImageProxy", "/ImageProxy/{token}/{contentLink}", | ||
new { controller = "ImageProxy", action = "Index" }); | ||
|
||
endpointRouteBuilder.MapControllerRoute("ExternalReviewLogin", | ||
$"/{options.PinCodeSecurity.ExternalReviewLoginUrl}", | ||
new { controller = "ExternalReviewLogin", action = "Index" }); | ||
|
||
endpointRouteBuilder.MapControllerRoute("ExternalReviewLoginSubmit", | ||
$"/{options.PinCodeSecurity.ExternalReviewLoginUrl}", | ||
new { controller = "ExternalReviewLogin", action = "Submit" }, | ||
new { httpMethod = new HttpMethodRouteConstraint(HttpMethods.Post) }); | ||
} | ||
} |
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
Oops, something went wrong.