Http2 WebDav support for windows explorer propfind not working

203 views Asked by At

I have recently updated a .net application from 3.1 to 6. Applications like microsoft office and microsoft explorer that support WebDav are now using http2 to process web requests. In doing so, windows explorer is no longer able to properly interpret my propfind response when the status is anything other than HTTP/1.1

Simply hardcoding the response from HTTP/2 to HTTP/1.1 allows windows explorer to function again. I cant seem to find any documentation that would suggest protocol changes are needed for Http2.

Here is an example propfind response. Is anyone aware of this bug or am I missing additional properties that are now required, or is this simply a Microsoft Explorer issue?

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
   <D:response>
      <D:href>https://localhost:5001/documents</D:href>
      <D:propstat>
         <D:prop>
            <creationdate>2022-01-09T01:06:56Z</creationdate>
            <displayname>Documents</displayname>
            <getcontentlength>0</getcontentlength>
            <getcontenttype>application/octet-stream</getcontenttype>
            <getlastmodified>2023-04-11T14:08:41Z</getlastmodified>
            <iscollection>1</iscollection>
            <isFolder>t</isFolder>
            <ishidden>0</ishidden>
            <D:resourcetype>
               <D:collection />
            </D:resourcetype>
            <supportedlock>
               <lockentry>
                  <lockscope>
                     <D:exclusive />
                  </lockscope>
                  <locktype>
                     <D:write />
                  </locktype>
               </lockentry>
            </supportedlock>
         </D:prop>
         <D:status>HTTP/2 200 OK</D:status>
      </D:propstat>
   </D:response>
</D:multistatus>
1

There are 1 answers

0
Jordan Brobyn On

It appears the issue was due to the <D:status> compliance related to major and minor versions of a HTTP protocol. Windows explorer mini-redirector seems to be very strict about this versioning compliance. According to RFC 2068 section 3.1

3.1 HTTP Version

   HTTP uses a "<major>.<minor>" numbering scheme to indicate versions
   of the protocol. The protocol versioning policy is intended to allow
   the sender to indicate the format of a message and its capacity for
   understanding further HTTP communication, rather than the features
   obtained via that communication. No change is made to the version
   number for the addition of message components which do not affect
   communication behavior or which only add to extensible field values.
   The <minor> number is incremented when the changes made to the
   protocol add features which do not change the general message parsing
   algorithm, but which may add to the message semantics and imply
   additional capabilities of the sender. The <major> number is
   incremented when the format of a message within the protocol is
   changed.

   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

          HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT

   Note that the major and minor numbers MUST be treated as separate
   integers and that each may be incremented higher than a single digit.
   Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is
   lower than HTTP/12.3. Leading zeros MUST be ignored by recipients and
   MUST NOT be sent.

   Applications sending Request or Response messages, as defined by this
   specification, MUST include an HTTP-Version of "HTTP/1.1". Use of
   this version number indicates that the sending application is at
   least conditionally compliant with this specification.

   The HTTP version of an application is the highest HTTP version for
   which the application is at least conditionally compliant.

Although the http context request protocol does not include a minor version, WebDAV compliance requires a minor version be added in the <D:status> of the response. For example:

<D:status>HTTP/2 200 OK</D:status>

should be

<D:status>HTTP/2.0 200 OK</D:status>