httpmodule

HttpModule Extends WebDAV - Throwing 500

半腔热情 提交于 2019-12-13 03:05:29
问题 I have an HttpModule with the following event handler installed on our WebDAV server. Many of our clients PUT files up to our server using the file creation semantic, they append the name of the file to create on the url, and the file is created by WebDAV on the server. Standard WebDAV. Some of our clients however don't have systems which can generate a dynamic file name on every call. They want a more traditional Webhook to POST (not PUT) to a static URL. This event handler, which fires

How can I get the tilde (~) operator to work when rewriting URLs in an HttpModule?

强颜欢笑 提交于 2019-12-12 15:27:39
问题 I am using RewritePath() in an IHttpModule to "route" to sub-web applications, as in this IIS layout: For example, when a request for /root/bleh comes in, an HTTP module in the root application rewrites the path to /root/obw in hopes that the obw application will take over. This mostly works, except that the tilde (~) does not resolve properly: The tilde operator resolves to the root web app after the rewrite, not the obw web app. This seems to be the sort of thing the rebaseClientPath

IHttpModule.BeginRequest firing 2X, Application_BeginRequest firing 1X

不问归期 提交于 2019-12-12 10:43:51
问题 I'm running VS 2008 and .NET 3.5 SP1. I want to implement hit tracking in an HttpModule in my ASP.NET app. Pretty simple, I thought. However, the BeginRequest event of my HttpModule is firing twice for each page hit. The site is very simple right now...no security, just a bit of database work. Should log one row per page hit. Why is this event firing twice? Moreover, IHttpModule.BeginRequest actually fires a different number of times for the first page hit when running for the first time

IIS seems like to sleep until the next request

我的梦境 提交于 2019-12-12 09:59:18
问题 I have created a httpModule for my Web Application which basically is triggered by a timer on specific schedules, it runs fine and the method I want is invoked after I publish it in IIS but what happens if there is no request it seems like the Web Application stops to a stand still making any scheduled events not to run, It will only run again only if I make a new request. What am I doing wrong? Can I make my website not sleep so that during times where there is no request the schduled

How do I get rid of DefaultAuthenticationModule module?

橙三吉。 提交于 2019-12-11 19:33:57
问题 I came to conclusion that I don't need DefaultAuthenticationModule in my application and I want to get rid of it. So I tried the following in web.config section responsible for modules: <remove name="DefaultAuthentication" /> and when I hit F5 in Visual Studio I see the following error message error ASPCONFIG: Special module of type 'DefaultAuthentication' cannot be added or removed manually. So how do I get rid of the module? 回答1: Try removing it from IIS refer, you can enable or disable the

HttpModule does not intercept js and css files in IIS 5.1

≡放荡痞女 提交于 2019-12-11 17:15:32
问题 I am implementing HttpModule for compressing request. Below is the codee for HttpModule: public class Global : IHttpModule { public void Init(HttpApplication app) { app.PostReleaseRequestState += new EventHandler(app_PostReleaseRequestState); } void app_PostReleaseRequestState(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; HttpContext context = app.Context; string acceptEncoding = context.Request.Headers["Accept-Encoding"]; // If gzip is supported then gzip it

Configuring SSL in IIS / ASP.NET

半腔热情 提交于 2019-12-11 11:36:03
问题 I'll try to be as brief as I can. I have the certificate already setup on my server. I just have a question about the.. proper way of configuring the ssl in my website. I need to secure at the root login.aspx and the admin and cart directories. So in IIS, you can right-click a file or directory in the site and go to Properties -> File/Directory Security tab -> Secure Communications section and click Edit -> check Require secure channel (SSL) . This causes the file or directory contents to be

How can I create an http handler to redirect all traffic to HTML pages?

て烟熏妆下的殇ゞ 提交于 2019-12-11 05:46:50
问题 Our company would like to redirect all calls to html files on our server to a separate page. The html pages are NOT in an asp.net application. In order to do this, I've been writing and IIS Handler in asp.net. 1) Is this possible to add an IIS handler to redirect static content that isn't served by any asp.net engine, i.e. stand alone files on the server? 2) If it is possible, how do I do this? I created an http handler in a class library. In the app.config I added the handler to the and

HTTP Response filter can't decode the response bytes the second time

谁说胖子不能爱 提交于 2019-12-11 05:15:27
问题 I developed an IIS 7 HttpModule. My goal is to check the response content for a particular tag. if the tag is found then something gets logged. To achieve my goal I developed a customized ASP NET Response Filter. This filter extends the .NET Stream class. The filter get registered on the OnPreRequestHandlerExecute(Object source, EventArgs e) event. The HTTP module has been registered correctly. The filter is working. The issue is that when I refreshed the page the Write the Write(byte[]

Http module Authentication

时光怂恿深爱的人放手 提交于 2019-12-11 03:59:10
问题 I'm using the code below from this post to try and create a custom http module : public class BasicAuthenticationModule: IHttpModule { public void Init(HttpApplication application) { application.AuthenticateRequest += new EventHandler(Do_Authentication); } private void Do_Authentication(object sender, EventArgs e) { var request = HttpContext.Current.Request; string header = request.Headers["HTTP_AUTHORIZATION"]; if(header != null && header.StartsWith("Basic ")) { // Header is good, let's