Update / intercept HttpContext.Current.Request.QueryString

It's weird here. I am reusing a code base, which, unfortunately, should not be updated. This code calls the call HttpContext.Current.Request.QueryString. Ideally, I need to add value to this collection with every request made. Is this possible - perhaps in an HTTP module?

+3
source share
2 answers

Without using reflection, the easiest way would be to use the RewritePath function for the current HttpContext object to modify the request.

Using IHttpModule , it might look something like this:

context.RewritePath(context.Request.Path, context.Request.PathInfo, newQueryStringHere!);

Hope this helps!

+6
source

Ditto Espo , , ( ) , ... RewritePath , , .

0

Source: https://habr.com/ru/post/1696589/


All Articles