Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite propfinds reporting files as directories #60

Closed
wants to merge 1 commit into from

Conversation

nickvergessen
Copy link
Member

Backport of #55

Since it's quite criticla for a lot of apps that use our webdav endpoint.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@MorrisJobke
Copy link
Member

For me this works already on stable11:

curl --request PROPFIND \
  --url 'http://192.168.99.100/server/remote.php/webdav/dsf?=' \
  --header 'authorization: Basic YWRtaW46YWRtaW4=' \
  --header 'content-type: application/xml' \
  --cookie 'cookie_test=test; occ1lehs6bp5=80d7t19mkh4j6agr73ktret4f2; oc_sessionPassphrase=BikTn10iZpdr6dgTbQynX9DAKLhed8wF8sNe98Zy6g9Q673b%252FOgV0Q5c%252Bc2dTIilDaqvkh%252BYCt%252BJkijVk1pOEjf5ymfOzH46Bxt778UGIZoN%252Fsi%252FSdjAugZddhG0oFeh; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; oc95fh0ebnef=kbu16s21li0l468k75jnpl7sq7; ocv78sh130w7=32oiug42nemh80t2r1hl087rn6; ockhugh6eb86=rr42qp520c62dh85r4ldrasnb7; ocgrs9o0f136=lj5gfidhcc178blbngqv75a897; PHPSESSID=u9nvkn374smr9ab0vgtdoo0io1' \
  --data '<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:">\n  <d:prop>\n    <d:resourcetype />\n  </d:prop>\n</d:propfind>'

The response is:

<?xml version="1.0"?>
<d:multistatus
	xmlns:d="DAV:"
	xmlns:s="http://sabredav.org/ns"
	xmlns:oc="http://owncloud.org/ns"
	xmlns:nc="http://nextcloud.org/ns">
	<d:response>
		<d:href>/server/remote.php/webdav/dsf/</d:href>
		<d:propstat>
			<d:prop>
				<d:resourcetype>
					<d:collection/>
				</d:resourcetype>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
	<d:response>
		<d:href>/server/remote.php/webdav/dsf/welcome.txt</d:href>
		<d:propstat>
			<d:prop>
				<d:resourcetype/>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>

@nickvergessen How to test this?

@nickvergessen
Copy link
Member Author

nextcloud/server#5543 (comment)

Okay, seems like some other condition made this appear in 12+ so lets only fix it there...

@nickvergessen nickvergessen deleted the backport-55-infinite-propfind branch July 24, 2017 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants