This file contains hidden or 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
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Extensions; | |
public class WebPMiddleware | |
{ | |
private readonly RequestDelegate _next; |
This file contains hidden or 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
public static HeaderPolicyCollection GetHeaderPolicyCollection(bool isDev) | |
{ | |
var policy = new HeaderPolicyCollection() | |
.AddFrameOptionsDeny() | |
.AddXssProtectionBlock() | |
.AddContentTypeOptionsNoSniff() | |
.AddReferrerPolicyStrictOriginWhenCrossOrigin() | |
.RemoveServerHeader() | |
.AddCrossOriginOpenerPolicy(builder => | |
{ |
This file contains hidden or 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
public interface ISiteMapXmlService | |
{ | |
public string GenerateXml(); | |
} |
This file contains hidden or 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
[ | |
{ | |
"outputFileName": "wwwroot/bundles/site.min.css", | |
"inputFiles": [ | |
"wwwroot/lib/bootstrap/dist/css/bootstrap.css", | |
"wwwroot/css/site.css" | |
] | |
}, | |
{ | |
"outputFileName": "wwwroot/bundles/site.min.js", |
This file contains hidden or 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
[ | |
{ | |
"outputFileName": "wwwroot/css/site.min.css", | |
"inputFiles": [ | |
"wwwroot/lib/bootstrap/dist/css/bootstrap.css", | |
"wwwroot/css/site.css" | |
] | |
}, | |
{ | |
"outputFileName": "wwwroot/js/site.min.js", |
This file contains hidden or 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
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Umbraco.Cms.Core.Cache; | |
using Umbraco.Cms.Core.Logging; | |
using Umbraco.Cms.Core.Routing; | |
using Umbraco.Cms.Core.Security; | |
using Umbraco.Cms.Core.Services; | |
using Umbraco.Cms.Core.Web; | |
using Umbraco.Cms.Infrastructure.Persistence; | |
using Umbraco.Cms.Web.Common.Models; |
This file contains hidden or 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
using Examine; | |
using Microsoft.Extensions.DependencyInjection; | |
using UmbHost.Core.Components; | |
using Umbraco.Cms.Core.Composing; | |
using Umbraco.Cms.Core.DependencyInjection; | |
using Umbraco.Cms.Infrastructure.Examine; | |
namespace UmbHost.Core.Composers | |
{ | |
public class IndexHelperComposer : IUserComposer |
This file contains hidden or 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
// jQuery plugin to prevent double submission of forms | |
jQuery.fn.preventDoubleSubmission = function () { | |
$(this).on('submit', function (e) { | |
e.preventDefault(); | |
var modal = $(this); | |
var $form = $(this).children('form').first(); | |
if ($form.data('submitted') === true) { | |
// Previously submitted - don't submit again |
This file contains hidden or 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
public class AnySurfaceController : SurfaceController | |
{ | |
private readonly IhCaptchaService _hCaptchaService; | |
public AnySurfaceController(IhCaptchaService hCaptchaService) | |
{ | |
_hCaptchaService = hCaptchaService; | |
} | |
[ValidateAntiForgeryToken] | |
[HttpPost] |