Comments (9)
Yes, the property WebProxy
doesn't do anything. I've changed a bit on the library, so it should support using a proxy. Unfortunately, I don't have a proxy configuration to test against.
I've created a new package on MyGet: https://www.myget.org/feed/decatec-preview/package/nuget/PortableWebDavLibrary
Could you please have a look at it and provide some feedback?
The only thing you'll have to do is set the new property UseProxy
on WebDavSession
to true
in order to change the internal handling when combining URIs.
from portable-webdav-library.
OK, here's a new beta version: https://www.myget.org/feed/decatec-preview/package/nuget/PortableWebDavLibrary
It contains:
- Removed the unused property
WebProxy
. WebDavSession.ListAsync
methods now have an optional parameteruriKind
(defaults toUriKind.Absolute
). WhenUriKind.Relative
is specified, the URIs of the resultingWebDavSessionItems
are relative URIs.
That will not work with your current WebDAV server as long as the wrong URLs are returned by the server. But you can give it a try when the server configuration was changed. Looking forward for your feedback.
from portable-webdav-library.
Yes it works! Thanks for the quick fix
from portable-webdav-library.
Thanks for your feedback!
But this is only a test with a preview version of the library.
Problems I need to solve before releasing new version:
- When using a constructor of
WebDavSession
which does not use aHttpMessageHandler
, the proxy has to be specified in the constructor. In this case theWebDavSession
"knows" that a proxy is used. When using a constructor specifying aHttpMessageHandler
which has the proxy settings in its internals, I don't know if a proxy should be used or not. Unfortunately, I cannot retrieve information about a proxy only with theHttpMessageHandler
used. Therefore I think about changing the signature of theWebDavSession
's constructors using aHttpClientHandler
. - In your case, the local server (hrefs in the result, MyLocalServer.localdoimain.com) provides absolute URIs. Thus, when combining URIs, I simply ignore the
BaseUri
(PublicWebDav.domain.com). What if the WebDAV server only provides relative URIs (e.g. not http://MyLocalServer.localdomain.com/Folder1, but only "Folder1"). Then the algorithm will fail.
Looking at your example above: PROPFIND for https://PublicWebdav.domain.com/RootFolder/ gives you result hrefs href=http://MyLocalServer.localdomain.com/Folder1 and href=http://MyLocalServer.localdomain.com/Folder2
What next, e.g. when you want to execute another PROPFIND for "Folder1"?
Would this be PROPFIND https://PublicWebdav.domain.com/RootFolder/Folder1 or http://MyLocalServer.localdomain.com/Folder1? I do think that only the first PROPFIND will work, so the WebDavSession.ListAsync
has to create a different href for that item.
If that is true, the algorithm for creating combined URIs has to be changed.
Any ideas?
And can you please provide a piece of code showing how you create the WebDavSession
?
from portable-webdav-library.
Yes, there are other problems after a few tests:
- Call
ListAsync
with relative URI throw exception - Call
ListAsync
with different URI ofbaseURI
throw exception
I was thinking to rewrite the URIs in response of PROPFIND with http://PublicWebdav.domain.com/RootFolter/ + relativeUriFromResult
It's not clean, but I do not see other solution.
Regarding HttpClientHandler
, I think it's better to leave HttpMessageHandler
in the constructor. Why put the WebProxy
in the constructor? He is already in HttpClientHandler
property, i can inject an HttpClientHandler
with proxy.
A property like bool ProcessResponseUri
could not be a solution?
from portable-webdav-library.
Well, simply combining the URIs this way should be a bit tricky. As an example: Looking at the URIs https://publicwebdav.domain.com/RootFolder/ and http://mylocalserver.localdomain.com/Folder1, what do they have in common? The host differs, but also the relative URIs.
What I can think of is that the proxy server does not handle the URIs correctly. The proxy should never return any URIs of the "local" server (behind the proxy) imho.
How does your proxy server configuration looks like? What comes to my mind is "ProxyPreserveHost" of Apache: see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypreservehost
from portable-webdav-library.
I agree, there is a Proxy configuration problem. Unfortunately it is not my WebDav server, but I will try to contact the administrator to see if he can adapt the configuration. I think he should send me relative URLs in responses.
I still think that calls should work and not generate an exception. The response is OK, the href does not have the same scheme or same domain, but it should be accepted. Leave the original href if UriHelper.CombineUri generates an exception would not be a solution?
from portable-webdav-library.
@YZahringer Have you tested the beta version yet? Is it working for you?
from portable-webdav-library.
I'll close this issue because v1.1.7.0 was just released.
Feel free to open the issue again when you have any problems with the new release.
from portable-webdav-library.
Related Issues (20)
- Editing WebDavSessionListItem Properties HOT 4
- Make WebDavSessionListItem's immutable HOT 1
- WebDavSession: add methods for Proppatch HOT 1
- Uploaded files have the upload time as last change date instead of the one of the uploaded file. HOT 7
- UriHelper: Add methods for combining Uri and URL HOT 1
- WebDavSession: Method to retrieve a list of supported WebDAV properties from a specific WebDAV server HOT 1
- Update the system.* dependencies to fix security issue HOT 1
- WebDavSession.ListAsync delivered the containing folder if the requested folder path contained spaces HOT 9
- Disable Expect: 100-continue header? HOT 8
- AdditionalProperties not working on Xamarin.Android (and possibly on Xamarin.iOS) HOT 2
- Assembly 'DecaTec.WebDav.XmlSerializers' not found HOT 3
- Problems with MoveAsync HOT 5
- Problem with char '#' in dest url (movesync) HOT 2
- Problem with empty loop in async operations HOT 12
- System.FormatException: String was not recognized as a valid DateTime. HOT 2
- Exception thrown: 'DecaTec.WebDav.Exceptions.WebDavException' in mscorlib.dll HOT 2
- WP8.1 WinRT exception at WebDavSession.ListAsync HOT 5
- Is listing only folders possible? HOT 1
- WebDavSession.ListAsync: URL with converted special characters is converted back HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portable-webdav-library.