Skip to content

Commit

Permalink
Allow HttpMethod override from QueryString and FormData as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 23, 2013
1 parent 355b137 commit 563057a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,23 @@ public NameValueCollection FormData
get { return this.Form; }
}

private string httpMethod;
public string HttpMethod
{
get
{
return httpMethod
?? (httpMethod = request.Headers[HttpHeaders.XHttpMethodOverride] ?? request.HttpMethod);
}
}
private string httpMethod;
public string HttpMethod
{
get
{
return httpMethod
?? (httpMethod = Param(HttpHeaders.XHttpMethodOverride)
?? request.HttpMethod);
}
}

public string Param(string name)
{
return Headers[name]
?? QueryString[name]
?? FormData[name];
}

public string ContentType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ public string HttpMethod
get
{
return httpMethod
?? (httpMethod = request.Headers[HttpHeaders.XHttpMethodOverride] ?? request.HttpMethod);
?? (httpMethod = Param(HttpHeaders.XHttpMethodOverride)
?? request.HttpMethod);
}
}

public string Param(string name)
{
return Headers[name]
?? QueryString[name]
?? FormData[name];
}

public string UserAgent
{
get { return request.UserAgent; }
Expand Down

0 comments on commit 563057a

Please sign in to comment.