ramondeklein/nwebdav

Running HttpListener under mono does not recognise Basic Authentication

zandam-xrn opened this issue · 1 comments

I followed your HttpListener example to put up a Webdav server.
Everything works fine running it under Windows, but I get some issues running on linux with mono.
In the DispatchHttpRequestsAsync function the request is intercepted and, with mono, the property IsAuthenticated is alway False, hance I'm not able to return the folder assigned to the user in the response.

Is there a workaround or a fix to this issue?

I checked the Mono source-code, but it seems that Mono doesn't support this property, see https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/HttpListenerRequest.cs#L452.

I don't have a Mono environment set up, but you might check the User property of the HttpListenerContext object. Otherwise you should be able to parse the Authorization header directly (link).