You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2018/07/13 13:31:01 UTC

[1/2] jena git commit: JENA-868: Base URL generation without protocol, host or port

Repository: jena
Updated Branches:
  refs/heads/master e15d2dfdb -> 5fcfb84eb


JENA-868: Base URL generation without protocol, host or port


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/f2fcbc76
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/f2fcbc76
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/f2fcbc76

Branch: refs/heads/master
Commit: f2fcbc76daaee52e3ee40afcee85f0b3a1c7ce63
Parents: 84b6434
Author: Andy Seaborne <an...@apache.org>
Authored: Sat Jul 7 16:14:57 2018 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Sat Jul 7 16:14:57 2018 +0100

----------------------------------------------------------------------
 .../src/main/webapp/js/app/models/dataset.js    | 12 ++++-
 .../main/webapp/js/app/models/fuseki-server.js  | 50 +++++++++-----------
 2 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/f2fcbc76/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/dataset.js
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/dataset.js b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/dataset.js
index 1a716a0..4fc192f 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/dataset.js
+++ b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/dataset.js
@@ -29,12 +29,20 @@ define(
                   } );
       },
 
+      /* x is the empty object if baseURL is "" 
+       * Ensure it is always a string.
+       */
+      getStr: function(key) {
+        var x = this.get( key );
+        return jQuery.isEmptyObject(x) ? "" : x ;
+      },
+  
       baseURL: function() {
-        return this.get( "baseURL" );
+        return this.getStr( "baseURL" );
       },
 
       mgmtURL: function() {
-        return this.get( "mgmtURL" );
+        return this.getStr( "mgmtURL" );
       },
 
       mgmtActionURL: function() {

http://git-wip-us.apache.org/repos/asf/jena/blob/f2fcbc76/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/fuseki-server.js
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/fuseki-server.js b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/fuseki-server.js
index 9c09574..336d0c7 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/fuseki-server.js
+++ b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/models/fuseki-server.js
@@ -138,35 +138,31 @@ define(
                      );
       },
 
-      /** Extract the server root path from the current window href */
+      /** Extract the server root path from the current window href
+       * This is the path, from /, without protocol, host or port.
+       * Then the browser adds protocol, host or port.
+       * Sometimes, the app does not know URL the browser used.
+       * For example, in docker, the port may have been remapped,
+       * or with a reverse proxy, https may have been terminated.
+       */
       currentRootPath: function() {
         var path = window.location.pathname.replace( /\/[^/]*$/, "" );
-
-		/*
-		console.log("window.location="+window.location) ;
-		console.log("window.location.href="+window.location.href) ;
-		console.log("window.location.protocol="+window.location.protocol) ;
-		console.log("window.location.host="+window.location.host) ;
-		console.log("window.location.hostname="+window.location.hostname) ;
-		console.log("window.location.port="+window.location.port) ;
-		console.log("window.location.pathname="+window.location.pathname) ;
-		console.log("window.location.origin="+window.location.origin) ;
-		console.log("window.location.hash="+window.location.hash) ;
-		console.log("window.location.search="+window.location.search) ;
-	    console.log("path='"+path+"'") ;
-		*/
-	
-		var path2 ;
-		var port = window.location.port ;
-		//console.log("port='"+port+"'") ;
-		if ( !port || 0 === port.length ) {
-		    // No explicit port.
-		    path2 = sprintf( "%s//%s%s",  window.location.protocol, window.location.hostname, path ) ;
-		} else {
-		    path2 = sprintf( "%s//%s:%s%s",  window.location.protocol, window.location.hostname, window.location.port, path );
-		}
-	    //console.log("path2='"+path2+"'") ;
-		return path2 ;
+          /*
+            console.log("window.location="+window.location) ;
+            console.log("window.location.href="+window.location.href) ;
+            
+            console.log("window.location.protocol="+window.location.protocol) ;
+            console.log("window.location.host="+window.location.host) ;
+            console.log("window.location.hostname="+window.location.hostname) ;
+            console.log("window.location.port="+window.location.port) ;
+            console.log("window.location.pathname="+window.location.pathname) ;
+            
+            console.log("window.location.origin="+window.location.origin) ;
+            console.log("window.location.hash="+window.location.hash) ;
+            console.log("window.location.search="+window.location.search) ;
+            console.log("path='"+path+"'") ;
+          */
+        return path ;
       }
     } );
 


[2/2] jena git commit: JENA-868: Merge commit 'refs/pull/446/head' of https://github.com/apache/jena

Posted by an...@apache.org.
JENA-868: Merge commit 'refs/pull/446/head' of https://github.com/apache/jena

This closes #446.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/5fcfb84e
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/5fcfb84e
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/5fcfb84e

Branch: refs/heads/master
Commit: 5fcfb84eb89d064ea85e054f791a10c2463b5ad7
Parents: e15d2df f2fcbc7
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Jul 13 14:30:37 2018 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Jul 13 14:30:37 2018 +0100

----------------------------------------------------------------------
 .../src/main/webapp/js/app/models/dataset.js    | 12 ++++-
 .../main/webapp/js/app/models/fuseki-server.js  | 50 +++++++++-----------
 2 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------