From f14586c5d63870119046fad9f95267999a02477b Mon Sep 17 00:00:00 2001 From: Chang Shu-Huai Date: Wed, 4 Sep 2024 22:33:22 +0800 Subject: [PATCH] Refs #40915, Update API explorer URL preview. --- templates/CRM/Admin/Page/APIExplorer.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index 8fe0766b0..7e9fb6e7b 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -149,7 +149,8 @@ cj(function($) { // generate preview var RESTquery = resourceBase + "extern/rest.php"+ query.substring(restURL.length,query.length); - var previewHtml = 'Rest URL Preview: \n'+ encodeURI(location.origin+RESTquery) + '\n'; + var restURLPreview = (location.protocol == 'https:') ? RESTquery : location.origin+RESTquery; + var previewHtml = 'Rest URL Preview: \n'+ encodeURI(restURLPreview) + '\n'; var json = fetchJson(); if (json) { json = JSON.parse(json);