diff --git a/DevProxy.Proxy.Kestrel/Internal/ProxyConnectionHandler.cs b/DevProxy.Proxy.Kestrel/Internal/ProxyConnectionHandler.cs index a685cbb1..8d58538e 100644 --- a/DevProxy.Proxy.Kestrel/Internal/ProxyConnectionHandler.cs +++ b/DevProxy.Proxy.Kestrel/Internal/ProxyConnectionHandler.cs @@ -278,7 +278,8 @@ private async Task BlindTunnelAsync(Stream clientStream, string host, int port, private async Task ExchangeAsync( Http1ConnectionReader reader, Stream clientStream, ParsedRequestHead head, string absoluteUrl, CancellationToken ct) { - if (!Uri.TryCreate(absoluteUrl, UriKind.Absolute, out var requestUri)) + if (!Uri.TryCreate(absoluteUrl, UriKind.Absolute, out var requestUri) + || (requestUri.Scheme != "http" && requestUri.Scheme != "https")) { await WriteErrorAsync(clientStream, HttpStatusCode.BadRequest, "Malformed request target", ct).ConfigureAwait(false); return false;