Skip to content

Commit b2fc68f

Browse files
Add additional SystemWeb HttpRequset properties to C# test stubs
1 parent 2db5f0d commit b2fc68f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

csharp/ql/test/resources/stubs/System.Web.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,37 @@ public class HttpRequest
178178
public string RawUrl { get; set; }
179179
public HttpCookieCollection Cookies => null;
180180
public bool IsAuthenticated { get; set; }
181+
public NameValueCollection Form => null;
182+
public NameValueCollection Headers => null;
183+
public NameValueCollection Params => null;
184+
public string UserAgent(string s) => null;
185+
public string UrlReferrer(string s) => null;
186+
public NameValueCollection ServerVariables => null;
187+
// Default property that goes through the collections
188+
// QueryString, Form, Cookies, ClientCertificate and ServerVariables
189+
public String this[String key]
190+
{
191+
get
192+
{
193+
String s;
194+
195+
s = QueryString[key];
196+
if (s != null)
197+
return s;
198+
199+
s = Form[key];
200+
if (s != null)
201+
return s;
202+
203+
HttpCookie c = Cookies[key];
204+
if (c != null)
205+
return c.Value;
206+
207+
s = ServerVariables[key];
208+
if (s != null)
209+
return s;
210+
}
211+
}
181212
}
182213

183214
public class HttpRequestWrapper : System.Web.HttpRequestBase

0 commit comments

Comments
 (0)