Adding custom headers

I need to create and add custom headers in an ASP.NET 2.0 application. This is a simulation of SSO input in our test environment.

When I try to add headers, I run "Not supported on this platform." error. BigJim has a good post on this subject here: http://bigjimindc.blogspot.com/2007/07/ms-kb928365-aspnet-requestheadersadd.html

The root of my problem is that I need to simulate various who enters my application. Not just adding static data to an HttpModule. I need to take values ​​from several text fields and pass the information from them to user headers, and then redirect the user. The HttpModule stuff comes from the very beginning ...

Anyone now if there is a simple redirection / proxy solution that can be used in a dev environment? Or is there a simple / beautiful way to do this in code?

+4
source share
5 answers

One of the methods that I used before, although with a long winding, is NUnitASP .

This is based on the NUnit framework, but is intended to test the ASP.NET user interface.

It basically launches the browser in memory and is able to manipulate the content just like a user. Using this, you can browse your page, enter data in text fields and send pages.

Hope this helps you complete the required testing. I used it to check the load, and the spider through my sites to collect data.

+1
source

If you use IIS 7, you can set integrated Pipeline mode

This setting is in the properties of the App-Pool.

+1
source

I could be wrong, but is Response.AddHeader() method not working?

Although I agree with Oscar that a formal testing solution such as NUnitASP is a good idea. Although, NUnitASP is a bit outdated. I still use it for some of my projects just because it still works; it's just not as sophisticated or simple as WaTiN or similar projects.

0
source

The browser drops the header if you execute Response.AddHeader () ... The header should be added to the original request ...

0
source

why not use an ASP.NET forms authentication model?

you define your "personal folders". if you try to connect to a private folder without logging in, you are automatically redirected to your user login page.

here are a couple of links: http://support.microsoft.com/kb/301240

http://www.asp.net/learn/security/tutorial-02-cs.aspx

0
source

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


All Articles