From 5d606e9e4b509ecce96cb4aa954a6149eac5139e Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Wed, 30 Oct 2024 16:29:42 +0100 Subject: [PATCH] Log the entire referrer URI --- .../instancemanagement/send/InstanceUploaderActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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";