Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Merge pull request #543 from dsimunic/eddfb7034360893b147b5289debcf98…


GetParams should not fail when `name` is null
  • Loading branch information...
commit 2db8e95b0e360d099546be307f3939c6dbd1a09f 2 parents a9af9ee + eddfb70
@mythz mythz authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/ServiceStack/ServiceHost/HttpRequestExtensions.cs
4 src/ServiceStack/ServiceHost/HttpRequestExtensions.cs
@@ -45,6 +45,10 @@ public static string GetParam(this IHttpRequest httpReq, string name)
if ((value = httpReq.QueryString[name]) != null) return value;
if ((value = httpReq.FormData[name]) != null) return value;
+ //IIS will assign null to params without a name: .../?some_value can be retrieved as req.Params[null]
+ //TryGetValue is not happy with null dictionary keys, so we should bail out here
+ if (string.IsNullOrEmpty(name)) return null;
Cookie cookie;
if (httpReq.Cookies.TryGetValue(name, out cookie)) return cookie.Value;

0 comments on commit 2db8e95

Please sign in to comment.
Something went wrong with that request. Please try again.