From 815240f920dd3679889f7e5092d3167e8f480fe6 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Thu, 21 Feb 2013 02:00:04 -0500 Subject: [PATCH] fix query string parsing issue --- MediaBrowser.Api/Images/ImageRequest.cs | 8 +-- MediaBrowser.Common/Net/HttpServer.cs | 82 +++++++++++++------------ 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/MediaBrowser.Api/Images/ImageRequest.cs b/MediaBrowser.Api/Images/ImageRequest.cs index 96e7a39cc4..ab10a62635 100644 --- a/MediaBrowser.Api/Images/ImageRequest.cs +++ b/MediaBrowser.Api/Images/ImageRequest.cs @@ -10,19 +10,19 @@ namespace MediaBrowser.Api.Images /// /// The max width /// - public int? MaxWidth; + public int? MaxWidth { get; set; } /// /// The max height /// - public int? MaxHeight; + public int? MaxHeight { get; set; } /// /// The width /// - public int? Width; + public int? Width { get; set; } /// /// The height /// - public int? Height; + public int? Height { get; set; } /// /// Gets or sets the quality. /// diff --git a/MediaBrowser.Common/Net/HttpServer.cs b/MediaBrowser.Common/Net/HttpServer.cs index 7bb81c1ca1..c09153064e 100644 --- a/MediaBrowser.Common/Net/HttpServer.cs +++ b/MediaBrowser.Common/Net/HttpServer.cs @@ -207,54 +207,58 @@ namespace MediaBrowser.Common.Net return; } - RaiseReceiveWebRequest(context); - try + Task.Run(() => { - ProcessRequest(context); - } - catch (InvalidOperationException ex) - { - HandleException(context.Response, ex, 422); + RaiseReceiveWebRequest(context); - throw; - } - catch (ResourceNotFoundException ex) - { - HandleException(context.Response, ex, 404); + try + { + ProcessRequest(context); + } + catch (InvalidOperationException ex) + { + HandleException(context.Response, ex, 422); - throw; - } - catch (FileNotFoundException ex) - { - HandleException(context.Response, ex, 404); + throw; + } + catch (ResourceNotFoundException ex) + { + HandleException(context.Response, ex, 404); - throw; - } - catch (DirectoryNotFoundException ex) - { - HandleException(context.Response, ex, 404); + throw; + } + catch (FileNotFoundException ex) + { + HandleException(context.Response, ex, 404); - throw; - } - catch (UnauthorizedAccessException ex) - { - HandleException(context.Response, ex, 401); + throw; + } + catch (DirectoryNotFoundException ex) + { + HandleException(context.Response, ex, 404); - throw; - } - catch (ArgumentException ex) - { - HandleException(context.Response, ex, 400); + throw; + } + catch (UnauthorizedAccessException ex) + { + HandleException(context.Response, ex, 401); - throw; - } - catch (Exception ex) - { - HandleException(context.Response, ex, 500); + throw; + } + catch (ArgumentException ex) + { + HandleException(context.Response, ex, 400); - throw; - } + throw; + } + catch (Exception ex) + { + HandleException(context.Response, ex, 500); + + throw; + } + }); } ///