Web Dav - Allowing Additional VerbsRSS

3 replies

Last post Feb 07, 2020 04:03 AM by Yuk Ding

  • Web Dav - Allowing Additional Verbs

    Feb 05, 2020 12:05 PM|tickles23|LINK

    Microsoft Win Server 2012 R2

    IIS 8.5

    We have a simple website (using Default Web Site) on IIS 8.5

    It is used to publish performance test results for an application. The end users have requested help enabling the PUT method on the website.

    This is key to automate their testing activities as they want to store HTML Reports through automation.

    So I followed the steps below:

    1. IIS Manager.

    2. Clicked on Default Web Site

    3. Go to "Handler Mappings".

    4. In the feature list, double clicked on "WebDAV".

    5. Clicked  on "Request Restrictions".

    6 .In the tab "Verbs" selected "All verbs" .

    So this did not work, I started to get errors even navigating to the web site.

    So then in Handler Mappings I removed WebDav and now the website is at least up again.

    So I wanted to make another attempt today. I can see in Server Management that WebDav role is definitely still installed. But it no longer appears in the list of Handler Mappings.

    Can someone please help?

  • Re: Web Dav - Allowing Additional Verbs

    Feb 06, 2020 04:47 AM|Yuk Ding|LINK

    Hi tickles23,

    So what error message and status code did you see when you enable All verbs? WebDAV  handler have quite high priority to handle request in order list.

    When you enable All verb for WeBDaV, web dav handler will even handle GET  request. That's why website can no longer being accessed.

    So if you want to allow PUT verb, please just specify required verb in One of the following verbs.

    If you want to take WebDAV handler back, please just create a module mapping and select WebDaVModule.

    Best Regards,

    Jokies Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: Web Dav - Allowing Additional Verbs

    Feb 06, 2020 10:10 AM|tickles23|LINK

    Hi,

    so I updated the web.config of my site as below:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <directoryBrowse enabled="true" />
    <handlers>
    <remove name="WebDAV" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <remove name="OPTIONSVerbHandler" />
    <remove name="TRACEVerbHandler" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
    <remove name="WebDAVModule" />
    </modules>
    <httpProtocol>
    <customHeaders>
    <add name="Access-Control-Allow-Origin" value="http://somedomain" />
    <add name="Access-Control-Expose-Headers" value="Content-Type, Accept, expiry, uid, access-token, token-type" />
    <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS,PUT,DELETE" />
    </customHeaders>
    </httpProtocol>
    </system.webServer>
    </configuration>

    .....

    <add name="Access-Control-Allow-Origin" value="http://somedomain" />

    Should value "http://somedomain be the name of my host server which is hosting the website? Apologies if this is really an obvious thing. I am learning this as I go!

    Thanks!

  • Re: Web Dav - Allowing Additional Verbs

    Feb 07, 2020 04:03 AM|Yuk Ding|LINK

    Hi tickles23,

    The value of Access-Control-Allow-Origin can be your Site's CNAME(FQDN) or IP address.  But CORS header should be used when you request sources cross domain.

    Best Regards,

    Jokies Ding 

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.