diff options
author | sr55 <[email protected]> | 2018-06-10 13:34:39 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-06-10 13:34:39 +0100 |
commit | 4a6a1bf9702977b1ea89a516c02bef64fb1b6e98 (patch) | |
tree | e6ffc90d8f81cc60df67d2741dc7580dc814b207 /win/CS/HandBrake.Worker/HttpServer.cs | |
parent | 0bbe6e4bde56799acd6c8096c04f80ca3aa27fb0 (diff) |
WinGui: HandBrake.Worker tidyup.
Diffstat (limited to 'win/CS/HandBrake.Worker/HttpServer.cs')
-rw-r--r-- | win/CS/HandBrake.Worker/HttpServer.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/win/CS/HandBrake.Worker/HttpServer.cs b/win/CS/HandBrake.Worker/HttpServer.cs index 4f23fa190..a920a85b3 100644 --- a/win/CS/HandBrake.Worker/HttpServer.cs +++ b/win/CS/HandBrake.Worker/HttpServer.cs @@ -57,13 +57,16 @@ namespace HandBrake.Worker (c) => { var context = c as HttpListenerContext; + if (context == null) + { + return; + } + try { - string requestType = context.Request.HttpMethod; string path = context.Request.RawUrl.TrimStart('/'); - Func<HttpListenerRequest, string> actionToPerform; - if (apiHandlers.TryGetValue(path, out actionToPerform)) + if (this.apiHandlers.TryGetValue(path, out var actionToPerform)) { string rstr = actionToPerform(context.Request); byte[] buf = Encoding.UTF8.GetBytes(rstr); @@ -84,7 +87,6 @@ namespace HandBrake.Worker } finally { - // always close the stream context?.Response.OutputStream.Close(); } }, |