开发者

Reading HTTP Request custom Headers

开发者 https://www.devze.com 2023-01-29 18:20 出处:网络
I am working on ASP.NET MVC 2 application. the website runs under SiteMinder (3rd party agent开发者_如何学Go) for authentication. The Siteminder injects custom header to the incoming HTTP request.But

I am working on ASP.NET MVC 2 application. the website runs under SiteMinder (3rd party agent开发者_如何学Go) for authentication. The Siteminder injects custom header to the incoming HTTP request. But when I try to read the custom header, I donot get the value.

System.Web.HttpContext.Current.Request.ServerVariables["CustomKey"];

Looks like these custom headers are getting stripped by MVC. I hav eensured that the headers are for sure getting injected by SiteMinder.

Am I doing anything wrong while reading as shown above?


You're looking for HttpRequest.Headers, not ServerVariables which represent variables served by IIS to the application:

System.Web.HttpContext.Current.Request.Headers["CustomKey"];


You you tried using Fiddler Http Proxy agent to verify that custom headers is injected by siteminder in the response header.??

0

精彩评论

暂无评论...
验证码 换一张
取 消