Commit 84d5e5ef authored by justcoding121's avatar justcoding121 Committed by justcoding121

cleanup

parent 0ea90e0c
...@@ -111,8 +111,7 @@ namespace Titanium.Web.Proxy.EventArguments ...@@ -111,8 +111,7 @@ namespace Titanium.Web.Proxy.EventArguments
private async Task ReadRequestBody() private async Task ReadRequestBody()
{ {
//GET request don't have a request body to read //GET request don't have a request body to read
var method = WebSession.Request.Method.ToUpper(); if (!WebSession.Request.HasBody)
if (method != "POST" && method != "PUT" && method != "PATCH")
{ {
throw new BodyNotFoundException("Request don't have a body. " + throw new BodyNotFoundException("Request don't have a body. " +
"Please verify that this request is a Http POST/PUT/PATCH and request " + "Please verify that this request is a Http POST/PUT/PATCH and request " +
......
...@@ -8,12 +8,15 @@ namespace Titanium.Web.Proxy.Helpers ...@@ -8,12 +8,15 @@ namespace Titanium.Web.Proxy.Helpers
internal class RunTime internal class RunTime
{ {
/// <summary> /// <summary>
/// Checks if current run time is Mono /// cache for mono runtime check
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
internal static Lazy<bool> isRunningOnMono private static Lazy<bool> isRunningOnMono
= new Lazy<bool>(()=> Type.GetType("Mono.Runtime") != null); = new Lazy<bool>(()=> Type.GetType("Mono.Runtime") != null);
/// <summary>
/// Is running on Mono?
/// </summary>
internal static bool IsRunningOnMono => isRunningOnMono.Value; internal static bool IsRunningOnMono => isRunningOnMono.Value;
} }
} }
...@@ -476,6 +476,7 @@ namespace Titanium.Web.Proxy ...@@ -476,6 +476,7 @@ namespace Titanium.Web.Proxy
if (!RunTime.IsRunningOnMono) if (!RunTime.IsRunningOnMono)
{ {
//clear orphaned windows auth states every 2 minutes
WinAuthEndPoint.ClearIdleStates(2); WinAuthEndPoint.ClearIdleStates(2);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment