From 5e97c634679591d889a8d3bb554ce8cfccbe42dc Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Thu, 27 Oct 2016 15:29:29 -0700 Subject: [PATCH] Throw PlatformNotSupportedException on big-endian platforms --- src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs b/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs index d9844714de..d26fa002b0 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs @@ -59,6 +59,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel { try { + if (!BitConverter.IsLittleEndian) + { + throw new PlatformNotSupportedException("Kestrel does not support big-endian architectures."); + } + ValidateOptions(); if (_disposables != null)