Unable to open documents using direct links from SharePoint 2019

Update (30-09-2019): This issue will be fixed by Microsoft with November CU 2019 for SharePoint Server 2019.

The response from the server is missing theĀ X-MS-InvokeApp: 1; RequireReadOnly header.

This issue happens when SharePoint configures new IIS Site, when we are creating a new web application or extending it. Where messed up one of the Response Header configuration which causes missing other required response headers like X-MS-InvokeApp: 1; RequireReadOnly

That causes Unable to open documents using direct links from SharePoint 2019.

ResponseHeaders

But it can be fix easy and manually.

Just go for your SharePoint IIS Site in IIS and open Response Headers and locate
-> “MicrosoftSharePointTeamServices: 16.0.0.10347” this is the issue
you need to move version to “Value”.

https://social.technet.microsoft.com/Forums/en-US/7f9d9994-e1a1-4e9d-aed3-8b28df848341/sharepoint-2019-response-headers-are-mixed-up?forum=SP2019

Our product group is aware this issue and working on this. (26/Agu/2019)

 

HttpHandler content-type as xml

        XmlNode xml = e.Xml;

        this.Response.Clear();

        string strXml = xml.OuterXml;
        this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xml");
        this.Response.AddHeader("Content-Length", strXml.Length.ToString());
        this.Response.ContentType = "application/xml";
        this.Response.Write(strXml);

        this.Response.End();