From d712238700cae35fb5a730b1db8f2450a2e2cb41 Mon Sep 17 00:00:00 2001 From: rfc2822 Date: Sun, 20 Jul 2014 14:29:52 +0200 Subject: [PATCH] Handle redirections to relative URLs correctly (see #282) + tests; minor GUI change --- res/layout/enter_credentials.xml | 5 +- .../davdroid/webdav/DavRedirectStrategy.java | 18 +++-- .../davdroid/webdav/WebDavResource.java | 7 +- test/robohydra/davdroid.conf | 2 +- .../plugins/{dav-default => dav}/index.js | 0 test/robohydra/plugins/redirect/index.js | 33 ++++++++- test/robohydra/plugins/simple.js | 28 +++++++ .../at/bitfire/davdroid/test/Constants.java | 19 +++++ .../webdav/DavRedirectStrategyTest.java | 73 +++++++++++++++++++ .../webdav/{test => }/WebDavResourceTest.java | 65 ++++++----------- 10 files changed, 193 insertions(+), 57 deletions(-) rename test/robohydra/plugins/{dav-default => dav}/index.js (100%) create mode 100644 test/robohydra/plugins/simple.js create mode 100644 test/src/at/bitfire/davdroid/test/Constants.java create mode 100644 test/src/at/bitfire/davdroid/webdav/DavRedirectStrategyTest.java rename test/src/at/bitfire/davdroid/webdav/{test => }/WebDavResourceTest.java (78%) diff --git a/res/layout/enter_credentials.xml b/res/layout/enter_credentials.xml index d49672ae..537856d9 100644 --- a/res/layout/enter_credentials.xml +++ b/res/layout/enter_credentials.xml @@ -26,7 +26,8 @@ members = dav.getMembers(); assertEquals(2, members.size()); - assertEquals(ROBOHYDRA_BASE + "dav/addressbooks/user%40domain/My%20Contacts%3a1.vcf/", members.get(0).getLocation().toString()); + assertEquals(Constants.ROBOHYDRA_BASE + "dav/addressbooks/user%40domain/My%20Contacts%3a1.vcf/", members.get(0).getLocation().toString()); assertEquals("HTTPS://example.com/user%40domain/absolute-url.vcf", members.get(1).getLocation().toString()); }