diff --git a/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/InstanceUploaderActivity.java b/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/InstanceUploaderActivity.java index 16e6f123c40..71d3699bf19 100644 --- a/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/InstanceUploaderActivity.java +++ b/collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/InstanceUploaderActivity.java @@ -178,7 +178,7 @@ private void init(Bundle savedInstanceState) { instanceUploaderTask = new InstanceUploaderTask(); if (url != null) { - instanceUploaderTask.setCompleteDestinationUrl(url + OpenRosaConstants.SUBMISSION, getReferrerHost(), true); + instanceUploaderTask.setCompleteDestinationUrl(url + OpenRosaConstants.SUBMISSION, getReferrerUri(), true); if (deleteInstanceAfterUpload != null) { instanceUploaderTask.setDeleteInstanceAfterSubmission(deleteInstanceAfterUpload); @@ -377,7 +377,7 @@ public void updatedCredentials() { // TODO: is this really needed here? When would the task not have gotten a server set in // init already? if (url != null) { - instanceUploaderTask.setCompleteDestinationUrl(url + OpenRosaConstants.SUBMISSION, getReferrerHost(), false); + instanceUploaderTask.setCompleteDestinationUrl(url + OpenRosaConstants.SUBMISSION, getReferrerUri(), false); } instanceUploaderTask.setRepositories(instancesRepository, formsRepository, settingsProvider); instanceUploaderTask.execute(instancesToSend); @@ -388,11 +388,11 @@ public void cancelledUpdatingCredentials() { finish(); } - private String getReferrerHost() { + private String getReferrerUri() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { Uri referrerUri = getReferrer(); if (referrerUri != null) { - return referrerUri.getHost(); + return referrerUri.toString(); } } return "unknown";