mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
update image encoding
This commit is contained in:
@@ -92,7 +92,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
{typeof (FileNotFoundException), 404},
|
||||
{typeof (DirectoryNotFoundException), 404},
|
||||
{typeof (SecurityException), 401},
|
||||
{typeof (UnauthorizedAccessException), 500}
|
||||
{typeof (PaymentRequiredException), 402},
|
||||
{typeof (UnauthorizedAccessException), 500},
|
||||
{typeof (ApplicationException), 500}
|
||||
};
|
||||
|
||||
HostConfig.Instance.DebugMode = true;
|
||||
|
||||
@@ -16,7 +16,10 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
/// <param name="duration">The duration.</param>
|
||||
public static void LogResponse(ILogger logger, int statusCode, string url, string endPoint, TimeSpan duration)
|
||||
{
|
||||
logger.Info("HTTP Response {0} to {1}. Time: {2}ms. {3}", statusCode, endPoint, Convert.ToInt32(duration.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), url);
|
||||
var durationMs = duration.TotalMilliseconds;
|
||||
var logSuffix = durationMs >= 1000 ? "ms (slow)" : "ms";
|
||||
|
||||
logger.Info("HTTP Response {0} to {1}. Time: {2}{3}. {4}", statusCode, endPoint, Convert.ToInt32(durationMs).ToString(CultureInfo.InvariantCulture), logSuffix, url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,15 +183,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
||||
/// <param name="request">The request.</param>
|
||||
private static void LogRequest(ILogger logger, HttpListenerRequest request)
|
||||
{
|
||||
var log = new StringBuilder();
|
||||
|
||||
var headers = string.Join(",", request.Headers.AllKeys.Where(i => !string.Equals(i, "cookie", StringComparison.OrdinalIgnoreCase) && !string.Equals(i, "Referer", StringComparison.OrdinalIgnoreCase)).Select(k => k + "=" + request.Headers[k]));
|
||||
|
||||
log.AppendLine("Ip: " + request.RemoteEndPoint + ". Headers: " + headers);
|
||||
|
||||
var type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod;
|
||||
|
||||
logger.LogMultiline(type + " " + request.Url, LogSeverity.Info, log);
|
||||
logger.Info("{0} {1}. UserAgent: {2}", (request.IsWebSocketRequest ? "WS" : "HTTP " + request.HttpMethod), request.Url, request.UserAgent ?? string.Empty);
|
||||
}
|
||||
|
||||
private void HandleError(Exception ex, HttpListenerContext context)
|
||||
|
||||
Reference in New Issue
Block a user