mattrajca / davkit Goto Github PK
View Code? Open in Web Editor NEWA Cocoa framework for talking to WebDAV servers
Home Page: http://mattrajca.com
License: MIT License
A Cocoa framework for talking to WebDAV servers
Home Page: http://mattrajca.com
License: MIT License
i try to integrate davkit with my ios App but when i try to connect to my webdav server i get the 404 Error , Here is my code
NSString root = @"https://137998.webdav.cloudsafe.com/test";
DAVCredentials *credentials = [DAVCredentials credentialsWithUsername:@"[email protected]" password:@"BXWHE6-HPHDSM-RXTIJW"];
DAVSession *session = [[DAVSession alloc] initWithRootURL:[NSURL URLWithString:root] credentials:credentials];
DAVRequest davRequest = [[DAVListingRequest alloc] initWithPath:root];
davRequest.delegate = self;
[session enqueueRequest:davRequest];
Many WebDAV servers use HTTP Digest authentication over HTTP Basic authentication for security reasons. The WebDAV spec itself even makes Digest authentication mandatory (at least when using insecure connections): http://www.webdav.org/specs/rfc4918.html#rfc.section.20.1
Would be great to see this implemented.
Thanks for the cool framework anyway โ works like a charm (with HTTP Basic authentication).
-- Michael
Tests don't work because DAVTestSettings.h
cannot be found.
please support LOCK and UNLOCK request
some NSInteger have to be changed to "long long" :
in DAVListingParser.m :
else if ([elementName isEqualToString:@"getcontentlength"]) {
DAVResponseItem.h :
-@Property (assign) NSInteger contentLength;
+@Property (assign) long long contentLength;
DAVResponseItem.m :
DAVRequest.m
75lines,
func start
if (![NSThread isMainThread]) {
[self performSelectorOnMainThread:@selector(start)
withObject:nil waitUntilDone:NO];
return;
}
I found an issue with GET request when access cloudme webdav.
Use DAVGetRequest, GET http://webdav.cloudme.com/my_account then the server reject the request with error code 404. But it works with OPTIONS method.
Hi there,
It seems [DAVListingParser parser: didStartElement: namespaceURI: qualifiedName: attributes:] generates a memory leak on _currentString in some cases. The leak happens when _currentString is not nil at the beginning of this method (in this case, it is always "\n", not sure where it comes from).
Adding
[currentString release];
just before
currentString = [[NSMutableString alloc] init];
does the trick.
By the way, keep up the good work!
Sources/Tests/EMoveTest.m file is testing DAVCopyRequest instead of DAVMoveRequest
If you try to access a resource with the wrong credentials, you will be stuck in a challenge/response loop, since connection:didReceiveAuthenticationChallenge does not evaluate the previousFailureCount field.
I fixed that in my code by adding:
if ( [challenge previousFailureCount] > DEFAULT_AUTHENTICATION_RETRY )
{
NSError* error = [NSError errorWithDomain:DAVClientErrorDomain code:404 userInfo:nil];
[self _didFail:error];
return;
}
Cheers,
:M:
It would much easier to keep track of requests if we could add success/completion blocks to them instead of using the delegate call backs. I haven't had time to delve into DAVKit and add them properly so have hacked on a category which can be found here:
https://gist.github.com/4155257
If I have time I'll try and add them in properly.
Hi,
what is the best way to include DAVKit into a swift project? Should I include the project-file or should I just copy the Source-folder?
Thanks in advance,
Max
Thanks for this great library !
I'm testing it on my iPhone and I've found a little problem with it :
when doing a DAVListingRequest, DAVKit is trying to decode "modificationdate" which is not in the webdav answer from my server ! Instead I got "getlastmodified" (which is following RFC1123 specification) :
lp1:getlastmodifiedWed, 16 Feb 2011 07:45:21 GMT/lp1:getlastmodified
Shouldn't you consider also this tag when analyzing answer ? (check https://gist.github.com/253828 for RCF1123 to NSDate conversion)
I can send you a patch for this if needed !
In DAVListingParser.m attribute names are compared including their namespace prefix:
if ([elementName isEqualToString:@"D:href"]) {...}
That is bound to fail in some cases since the namespace prefix is variable and can be set to the creator's liking.
I'll create a patch implementing
- (void)parser:(NSXMLParser *)parser didStartMappingPrefix:(NSString *)prefix toURI:(NSString *)namespaceURI
and will provide it here.
-- Michael
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.