SVNKit with HTTPv2 fails to delete entry

We are seeing indications that SVNKit fails to encode path correctly when performing DELETE with HTTPv2 enabled.

127.0.0.1 - removed 2021-04-15 22:13:16 "GET /svn/demo2/!svn/rvr/66/dita/xml/map/Resource%20Manager%20Actions%20(map).xml HTTP/1.1" 200 1000 "-" "SVN/1.10.0 SVNKit/1.10.3 (http://svnkit.com/) r10808"
127.0.0.1 - removed 2021-04-15 22:13:16 "PROPFIND /svn/demo2/dita/release/A/xml/map HTTP/1.1" 207 1586 "-" "SVN/1.10.0 SVNKit/1.10.3 (http://svnkit.com/) r10808"
127.0.0.1 - removed 2021-04-15 22:13:16 "POST /svn/demo2/!svn/me HTTP/1.1" 201 231 "-" "SVN/1.10.0 SVNKit/1.10.3 (http://svnkit.com/) r10808"
127.0.0.1 - - 2021-04-15 22:13:16 "DELETE /svn/demo2/!svn/txr/66-1u/dita/release/A/xml/map/Resource Manager" 400 0 "-" "-"
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: DELETE of '/svn/test-1f3cvw1ew.se.simonsoft.cms.backend.svnkit.commit.CmsCommitImplIntegrationTest/!svn/txr/1-1/te st.txt': 400 Bad Request (http://localhost)
svn: E175002: DELETE request failed on '/svn/test-1f3cvw1ew.se.simonsoft.cms.backend.svnkit.commit.CmsCommitImplIntegrationTest/!svn/txr/1-1/te st.txt'
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:112)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:96)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:765)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:340)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:914)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doDelete(DAVConnection.java:460)
	at org.tmatesoft.svn.core.internal.io.dav.DAVCommitEditor.deleteEntry(DAVCommitEditor.java:165)
	at se.simonsoft.cms.backend.svnkit.commit.handlers.FileDeleteHandler.handle(FileDeleteHandler.java:39)

I suggest moving this line in DavCommitEditor:

 path = SVNEncodingUtil.uriEncode(path);

upwards so it becomes the first line in deleteEntry method (before “if httpV2”).

Thanks,
Thomas Å.

Hello Thomas,
thanks for reporting this bug and the solution to it.

I’ve created an issue for it:
https://issues.tmatesoft.com/issue/SVNKIT-758

The fix will be included into the next SVNKit release. If you don’t want to wait, you can build SVNKit directly from sources:

./gradlew svnkit:clean svnkit:build -x svnkit:javadoc -x svnkit:test svnkit-cli:clean svnkit-cli:build svnkit-distribution:clean svnkit-distribution:build

Hello Dmitry,

Thanks for the commit.

Any chance you will post a build in your snapshots maven repo? That would enable us to much more easily run our test suite on our build server to confirm the fix.

Thanks,
Thomas Å.

Done, have a try: Index of /repositories/snapshots/org/tmatesoft/svnkit/svnkit/1.10.4-SNAPSHOT

Thanks, fix confirmed in our test suite.