]> _ Git - fluidbook-html5.git/commitdiff
wip #7112 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Oct 2024 16:51:17 +0000 (18:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 1 Oct 2024 16:51:17 +0000 (18:51 +0200)
js/libs/fluidbook/fluidbook.loader.js

index e375c295dbe20a886f366040e40b5faf5ec16719..631035db1efc0659263a7f7b00f8bb1c486fb5fb 100644 (file)
@@ -897,7 +897,7 @@ FluidbookLoader.prototype = {
     },
 
     getURL(url) {
-        if (!this.loadbalancing) {
+        if (!this.loadbalancing || this.checkExcludedFromLoadBalancing(url)) {
             return url;
         }
 
@@ -907,6 +907,16 @@ FluidbookLoader.prototype = {
         return 'https://' + this._loadbalancingServerURL[url] + '/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.hash + '/' + url;
     },
 
+    checkExcludedFromLoadBalancing: function (url) {
+        for (let i in this.fluidbook.settings.hosting_loadbalancer_ignore) {
+            let r = this.fluidbook.settings.hosting_loadbalancer_ignore[i];
+            if (url.indexOf(r) !== -1) {
+                return true;
+            }
+        }
+        return false;
+    },
+
     getTexture: function (page, callback, enter) {
         if (enter === undefined) {
             enter = true;