IIS Send 200 Instead of 405 when POST to a Static File

se flag

I am trying to deploy a static network speed test application. IIS need to behave like This Nginx Config.

Everything working fine, but I need to send 200 instead of 405. When Running Upload Test. (POST request to a Static File)

Looking for ISS Equivalent like Nginx "error_page 405 =200"

<?xml version="1.0" encoding="UTF-8"?>

            <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
        <mimeMap fileExtension="." mimeType="application/octet-stream" />
  <urlCompression doStaticCompression="false" />
                <add name="Cache-Control" value="no-store, no-cache, no-transform, must-revalidate" />
        <caching enabled="false" enableKernelCache="false" />
                    <add verb="POST" allowed="true" />
                    <add verb="GET" allowed="true" />
                    <add fileExtension="." allowed="true" />
        <requestLimits maxAllowedContentLength="2147483647"/>
cn flag

You can try it with rewrute rules. Make sure you change the match url directive according to what you need:

        <rule name="customResponseCode">
            <match url=".*" />
            <action type="CustomResponse" statusCode="200" />
user3642342 avatar
se flag
Yes, This worked. Added <match url="upload" />

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.