Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think the best way of handling this is to use a http module that will check the header and inject the user agent if necessary. </p> <p>As you have found out you cannot use the set method on the Headers object. Instead you will have to inject the user agent string into the header via protected properties that can be accessed through reflection as outlined in the answer to <a href="https://stackoverflow.com/questions/4091157/httpmodule-to-add-headers-to-request">this question</a>.</p> <h2>UPDATE</h2> <p>Unfortunately <code>Request.UserAgent</code> doesn't use the information held in <code>Request.Headers</code>, instead it calls the method <code>GetKnownRequestHeader</code> in <a href="http://msdn.microsoft.com/en-us/library/system.web.httpworkerrequest%28v=vs.100%29.aspx" rel="nofollow noreferrer">HttpWorkerRequest</a>. This is an abstract class and from looking at the decompiled library code the actual implementation varies depending on the hosting environment. Therefore I cannot see a way to replace the user agent string in a reliable manner via reflection. You could roll your own WorkerRequest class but for the amount of effort I don't think the payoff would be worth it. </p> <p>Sorry to be negative but I think its just not possible to set the user agent within the web application in a simple manner. Your best option at the moment would be to perform a pre-check for a user agent, and if the request doesn't have one return a browser not supported error message.</p> <p>You could also investigate injecting something earlier on, i.e. in IIS or at your proxy server if you use one.</p> <p>Also I would recommend that this issue is reported to SAP. I know they are actively working on the Viewer at the moment and who knows they might fix it and maybe even add support for Opera!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload