-
Notifications
You must be signed in to change notification settings - Fork 363
Uri in xml response must be url encoded. #1591
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
base: master
Are you sure you want to change the base?
Changes from 5 commits
0ab236f
03940b8
9d58022
3aca3d5
e33db5e
863d6c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -920,4 +920,14 @@ public function testGetTimeoutHeaderInvalid() | |
| $this->server->httpRequest = $request; | ||
| $this->locksPlugin->getTimeoutHeader(); | ||
| } | ||
|
|
||
| public function testLockWithSpaces() | ||
| { | ||
| $request = new HTTP\Request('LOCK', '/test .txt', [ | ||
| 'Timeout' => 'second-5, infinite', | ||
| ]); | ||
| $this->server->httpRequest = $request; | ||
| $this->server->exec(); | ||
| self::assertEquals(201, $this->response->status); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should assert the activelock/lockroot/href property in the XML response. That's where the encoding problem would be visible.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a check for the lock token, in the error case no lock token is visiblr.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not make sense. Your change adds
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My starting point is this line in the logs of the webserver: and on the terminal I get In the error case the XML-response contains an exception: On success the the token: This is, what I try test, tell me if I'm wrong ...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ConflictingLock exceptions are thrown in line 170 and 178. Your change is after that, so I don't see how that fixes anything, especially after
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, in the initial pull request description you mention problem with lockroot, so why now you test something different? Seems there might be two different issues.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is, that the used client (libneon) has strict checking of urls. The uri in the LOCK request and the url in the xml response differ:
I already mentioned, that a test is maybe difficult as long as no strict client is used. Maybe the error above is only consequential error of this problem.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not find a method to use the original uri in the lock xml-response, that is maybe the real problem. |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do this here you might have it fixed for LOCK request, but what about PROPFIND?
I think the fix should rather go to
Sabre\DAV\Xml\Property\LockDiscovery::xmlSerialize(), but I don't really know this code yet. There\Sabre\HTTP\encodePath()should be used, I guess.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have any problmes or errors in PROPFIND calls, why should I change anything?
I can create directories with spaces in the name and inside this directory I can create a file with spaces in the name.
From my experience only LOCK is broken/affected.