aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-21 02:00:04 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-21 02:00:04 -0500
commit815240f920dd3679889f7e5092d3167e8f480fe6 (patch)
tree75ba67bd04530c68d9a7777748ba1257bf244593
parentbd2f385e563324405c36689f9bb1609455c4d3ec (diff)
fix query string parsing issue
-rw-r--r--MediaBrowser.Api/Images/ImageRequest.cs8
-rw-r--r--MediaBrowser.Common/Net/HttpServer.cs82
2 files changed, 47 insertions, 43 deletions
diff --git a/MediaBrowser.Api/Images/ImageRequest.cs b/MediaBrowser.Api/Images/ImageRequest.cs
index 96e7a39cc..ab10a6263 100644
--- a/MediaBrowser.Api/Images/ImageRequest.cs
+++ b/MediaBrowser.Api/Images/ImageRequest.cs
@@ -10,19 +10,19 @@ namespace MediaBrowser.Api.Images
/// <summary>
/// The max width
/// </summary>
- public int? MaxWidth;
+ public int? MaxWidth { get; set; }
/// <summary>
/// The max height
/// </summary>
- public int? MaxHeight;
+ public int? MaxHeight { get; set; }
/// <summary>
/// The width
/// </summary>
- public int? Width;
+ public int? Width { get; set; }
/// <summary>
/// The height
/// </summary>
- public int? Height;
+ public int? Height { get; set; }
/// <summary>
/// Gets or sets the quality.
/// </summary>
diff --git a/MediaBrowser.Common/Net/HttpServer.cs b/MediaBrowser.Common/Net/HttpServer.cs
index 7bb81c1ca..c09153064 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
- {
- ProcessRequest(context);
- }
- catch (InvalidOperationException ex)
+ Task.Run(() =>
{
- 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;
+ }
+ });
}
/// <summary>