Skip to content

Commit

Permalink
Fix 500 error when invalid char in url
Browse files Browse the repository at this point in the history
  • Loading branch information
RvVeen committed Sep 21, 2020
1 parent dd98535 commit e739be2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pdfviewer/pdfJsViewer/pdfJsViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ angular.module('pdfviewerPdfJsViewer', ['servoy']).directive('pdfviewerPdfJsView
$scope.documentURL = "pdfviewer/pdfJsViewer/web/viewer.html";
if ($scope.model.dataProviderID && $scope.model.dataProviderID.url) {
var serverUrl = window.location.href.split('/solutions/')[0];
$scope.documentURL += "?file=" + (serverUrl + '/' + $scope.model.dataProviderID.url);
$scope.documentURL += "?file=" + encodeURIComponent(serverUrl + '/' + $scope.model.dataProviderID.url);
} else if ($scope.model.documentURL) {
// console.warn('Using documentURL is deprecated, this property is replaced for dataprovider property');
$scope.documentURL += "?file=" + ($scope.model.documentURL);
Expand Down
2 changes: 1 addition & 1 deletion pdfviewer/pdfViewer/pdfViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angular.module('pdfviewerPdfViewer', ['servoy']).directive('pdfviewerPdfViewer',
$scope.documentURL = "";
if ($scope.model.dataProviderID && $scope.model.dataProviderID.url) {
var serverUrl = window.location.href.split('/solutions/')[0];
$scope.documentURL += serverUrl + '/' + $scope.model.dataProviderID.url;
$scope.documentURL += encodeURIComponent(serverUrl + '/' + $scope.model.dataProviderID.url);
} else if ($scope.model.documentURL) {
// console.warn('Using documentURL is deprecated, this property is replaced for dataprovider property');
$scope.documentURL += $scope.model.documentURL;
Expand Down

0 comments on commit e739be2

Please sign in to comment.