From 21914683f59112c38991b21cf9266c1b762a8f83 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 7 Dec 2020 10:05:57 +0300 Subject: [PATCH 1/2] Fix broken test --- ApiDoctor.Validation/Http/HttpParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApiDoctor.Validation/Http/HttpParser.cs b/ApiDoctor.Validation/Http/HttpParser.cs index b71cbda1..f7faa641 100644 --- a/ApiDoctor.Validation/Http/HttpParser.cs +++ b/ApiDoctor.Validation/Http/HttpParser.cs @@ -72,7 +72,7 @@ public static HttpRequest ParseHttpRequest(string requestString) throw new HttpParserRequestException("Request contains an HTTP response."); string url; - var httpVersion = components.Last().StartsWith("HTTP/") ? components[1] : "HTTP/1.1"; + var httpVersion = components[1].StartsWith("HTTP/") ? components[1] : "HTTP/1.1"; if (components.Length > 2) { //Assume Odata Uri in the form https://graph.microsoft.com/beta/riskyUsers?$filter=riskLevel eq microsoft.graph.riskLevel'medium' From db05fa9296556560de9e6bec34c013b131dff25c Mon Sep 17 00:00:00 2001 From: Eastman Date: Mon, 7 Dec 2020 20:01:10 +0300 Subject: [PATCH 2/2] Update ApiDoctor.Validation/Http/HttpParser.cs Co-authored-by: Vincent Biret --- ApiDoctor.Validation/Http/HttpParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApiDoctor.Validation/Http/HttpParser.cs b/ApiDoctor.Validation/Http/HttpParser.cs index f7faa641..3487dec1 100644 --- a/ApiDoctor.Validation/Http/HttpParser.cs +++ b/ApiDoctor.Validation/Http/HttpParser.cs @@ -72,7 +72,7 @@ public static HttpRequest ParseHttpRequest(string requestString) throw new HttpParserRequestException("Request contains an HTTP response."); string url; - var httpVersion = components[1].StartsWith("HTTP/") ? components[1] : "HTTP/1.1"; + var httpVersion = components.Skip(1).First().StartsWith("HTTP/") ? components[1] : "HTTP/1.1"; if (components.Length > 2) { //Assume Odata Uri in the form https://graph.microsoft.com/beta/riskyUsers?$filter=riskLevel eq microsoft.graph.riskLevel'medium' @@ -263,4 +263,4 @@ private enum ParserMode Body } } -} \ No newline at end of file +}