Skip to content

Commit

Permalink
Updated fileApiService to include proxy redirection and relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrouse committed Dec 19, 2021
1 parent 436f485 commit 9f66d13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,10 @@ jQuery.each(['get', 'put', 'delete', 'post'], function (i, method) {
}
};
var cbShowSuccess = function (data, status, jqXHR) { };
var serviceUrl = $('body').attr('data-apiserviceurl') + (!url.startsWith('/') ? '/' : '') + url;

var useProxy = makeBool($('body').attr('data-apiproxy'));
var serviceUrl = useProxy ? '/njsPC' + (!url.startsWith('/') ? '/' : '') + url : $('body').attr('data-apiserviceurl') + (!url.startsWith('/') ? '/' : '') + url;
if (serviceUrl.startsWith('/')) serviceUrl = serviceUrl.substring(1);
console.log({ serviceUrl: serviceUrl, useProxy: useProxy });

// Set up the callbacks.
successCallback = $.mergeCallbacks(successCallback, cbShowSuccess);
Expand Down

0 comments on commit 9f66d13

Please sign in to comment.