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
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
namespace MyApplication | |
{ | |
public class ResponseHeaderMiddleware | |
{ | |
private readonly RequestDelegate _next; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Extensions.Options; | |
namespace SixLabors.ImageSharp.Web.Providers | |
{ | |
public class AllowedDomainsRemoteImageUrlValidator: IRemoteImageUrlValidator | |
{ | |
private readonly List<string> _allowedDomains; |
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
var jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0b3B0YWwuY29tIiwiZXhwIjoxNDI2NDIwODAwLCJodHRwOi8vdG9wdGFsLmNvbS9qd3RfY2xhaW1zL2lzX2FkbWluIjp0cnVlLCJjb21wYW55IjoiVG9wdGFsIiwiYXdlc29tZSI6dHJ1ZX0.yRQYnWzskCZUxPwaQupWkiUzKELZ49eM7oWxAQK_ZXw'; | |
console.log(decodeJsonWebToken(jwt)); | |
function decodeJsonWebToken(token){ | |
var tokenParts = token.split('.'); | |
return { | |
header: decodeTokenPart(tokenParts[0]), | |
token: decodeTokenPart(tokenPart[1]), | |
signature: tokenPart[2] | |
}; |
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
/** | |
* @ngdoc object | |
* @name pascalprecht.translate.$translateDefaultInterpolation | |
* @requires $interpolate | |
* | |
* @description | |
* Uses angular's `$interpolate` services to interpolate strings against some values. | |
* | |
* @return {object} $translateInterpolator Interpolator service | |
*/ |