|
@@ -60,22 +60,28 @@ namespace PlatformBenchmarks
|
|
|
#endif
|
|
|
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
|
|
|
{
|
|
|
- var requestType = RequestType.NotRecognized;
|
|
|
+#if !DATABASE
|
|
|
if (method == HttpMethod.Get)
|
|
|
{
|
|
|
-#if !DATABASE
|
|
|
if (path.Length >= 2 && path[0] == '/')
|
|
|
{
|
|
|
- if (path[1] == 'j')
|
|
|
+ if (path[1] == 'p')
|
|
|
{
|
|
|
- requestType = RequestType.Json;
|
|
|
+ _requestType = RequestType.PlainText;
|
|
|
+ return;
|
|
|
}
|
|
|
- else if (path[1] == 'p')
|
|
|
+ if (path[1] == 'j')
|
|
|
{
|
|
|
- requestType = RequestType.PlainText;
|
|
|
+ _requestType = RequestType.Json;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ _requestType = RequestType.NotRecognized;
|
|
|
#else
|
|
|
+ var requestType = RequestType.NotRecognized;
|
|
|
+ if (method == HttpMethod.Get)
|
|
|
+ {
|
|
|
var pathLength = path.Length;
|
|
|
if (Paths.SingleQuery.Length <= pathLength && path.StartsWith(Paths.SingleQuery))
|
|
|
{
|
|
@@ -95,10 +101,9 @@ namespace PlatformBenchmarks
|
|
|
_queries = ParseQueries(path, Paths.MultipleQueries.Length);
|
|
|
requestType = RequestType.MultipleQueries;
|
|
|
}
|
|
|
-#endif
|
|
|
}
|
|
|
-
|
|
|
_requestType = requestType;
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|