Skip to content

Instantly share code, notes, and snippets.

View xakpc's full-sized avatar

Pavel Osadchuk xakpc

View GitHub Profile
@xakpc
xakpc / HashnodeSitemapFunction.cs
Created September 19, 2023 22:39
Azure Function To Fix Hashnode Sitemap
using System;
using System.IO;
using System.Threading.Tasks;
using System.Web.Http;
using System.Xml.Serialization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
@xakpc
xakpc / Program.cs
Created September 25, 2023 10:17
Middleware to check header example
using Microsoft.AspNetCore.Mvc;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.Configure<RouteHandlerOptions>(o => o.ThrowOnBadRequest = true);
var app = builder.Build();
// middleware to check content-type header
app.Use(async (context, next) =>