I have an owin project I am hosting it using Microsoft.Owin.Host.SystemWeb. It works fine but if I have a Dot in the url it fails and I get a 404. For example
localhost:4070/cdn/aa works
but
localhost:4070/cdn/a.a doesn't work
I have also done the following changes in
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
I am sure this setting solves the problem in plain asp.net web api but I am having this issue with Owin.
update
I have tried this with owin host it is similar behavior, the calls with "." are not routed to webapi.
I can understand the behavior that when there is a dot in the last part of the url the framework thinks it is a file and tries to handle it but my problem is that I would like to handle these urls in my normal pipeline. I am actually writing a proxy for Microsoft cdn and the files are generated on run time using another server.
Hosting of OWIN in IISUse the following procedure. Step 1: Open the Visual Studio and create the "New Project". Step 2: Create the new ASP.NET Web Application and enter the name for the application. Step 3: Select the Empty Project Template to create the application.
SystemWeb. OWIN server that enables OWIN-based applications to run on IIS using the ASP.NET request pipeline.
The OwinStartup attribute specifies the production startup class is run. Create another OWIN Startup class and name it TestStartup .
This config worked for me:
<system.webServer>
<handlers>
<add name="OWIN" path="*" verb="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler" />
</handlers>
</system.webServer>
In odred to get file path from "public/" folder and put it in response I ended up with this:
string filePath = System.Web.Hosting.HostingEnvironment.MapPath("~/public" + context.Request.Path);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With