aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-24 16:24:12 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-24 16:24:12 -0400
commit768f20b1bbc16c9f0eb013a486d472dc7d2684a2 (patch)
treea1fce68d7c18562789159d241fcb409400587ae5
parentde5a8d579bbc08be23ea7c3d250f33106d3aabd2 (diff)
update response headers for HEAD requests
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs8
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
-rw-r--r--SharedVersion.cs2
3 files changed, 10 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 86df798d0..0e68389da 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -579,7 +579,13 @@ namespace Emby.Server.Implementations.HttpServer
catch (Exception ex)
{
- ErrorHandler(ex, httpReq, !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase));
+ var logException = !string.Equals(ex.GetType().Name, "SocketException", StringComparison.OrdinalIgnoreCase);
+
+#if DEBUG
+ logException = true;
+#endif
+
+ ErrorHandler(ex, httpReq, logException);
}
finally
{
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
index b06a6a887..a70aad14e 100644
--- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -424,16 +424,6 @@ namespace Emby.Server.Implementations.HttpServer
options.ResponseHeaders = options.ResponseHeaders ?? new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- if (!options.ResponseHeaders.ContainsKey("Content-Disposition"))
- {
- // Quotes are valid in linux. They'll possibly cause issues here
- var filename = (Path.GetFileName(path) ?? string.Empty).Replace("\"", string.Empty);
- if (!string.IsNullOrWhiteSpace(filename))
- {
- options.ResponseHeaders["Content-Disposition"] = "inline; filename=\"" + filename + "\"";
- }
- }
-
return GetStaticResult(requestContext, options);
}
@@ -490,7 +480,8 @@ namespace Emby.Server.Implementations.HttpServer
return result;
}
- var isHeadRequest = options.IsHeadRequest;
+ // TODO: We don't really need the option value
+ var isHeadRequest = options.IsHeadRequest || string.Equals(requestContext.Verb, "HEAD", StringComparison.OrdinalIgnoreCase);
var factoryFn = options.ContentFactory;
var responseHeaders = options.ResponseHeaders;
diff --git a/SharedVersion.cs b/SharedVersion.cs
index 82a72685b..1093bcd4c 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.2.32.4")]
+[assembly: AssemblyVersion("3.2.32.5")]