Skip to content

Apache Lucene open-source search software

SOLR-4045: SOLR admin page returns HTTP 404 on core names containing a '.' (dot)

Stefan Matheis8172b5d5350b
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0a6f891a075..152ed1fe5de 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -445,6 +445,8 @@ Bug Fixes
* SOLR-4257: PeerSync updates and Log Replay updates should not wait for
a ZooKeeper connection in order to proceed. (yonik)
+* SOLR-4045: SOLR admin page returns HTTP 404 on core names containing
+ a '.' (dot) (steffkes)
Other Changes
----------------------
diff --git a/solr/webapp/web/js/scripts/analysis.js b/solr/webapp/web/js/scripts/analysis.js
index 2a7a71a2314..ede8ba707ea 100644
--- a/solr/webapp/web/js/scripts/analysis.js
+++ b/solr/webapp/web/js/scripts/analysis.js
@@ -18,7 +18,7 @@
// #/:core/analysis
sammy.get
(
- /^#\/([\w\d-]+)\/(analysis)$/,
+ new RegExp( app.core_regex_base + '\\/(analysis)$' ),
function( context )
{
var active_core = this.active_core;
diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js
index c0835b1fb62..3df019ab30b 100644
--- a/solr/webapp/web/js/scripts/app.js
+++ b/solr/webapp/web/js/scripts/app.js
@@ -100,7 +100,7 @@ var sammy = $.sammy
{
var selector = '~' === this.params.splat[0][0]
? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
- : '#menu-selector #' + this.params.splat[0];
+ : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' );
var active_element = $( selector, menu_wrapper );
@@ -152,6 +152,8 @@ var solr_admin = function( app_config )
this.timeout = null;
+ this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
+
show_global_error = function( error )
{
var main = $( '#main' );
@@ -205,7 +207,7 @@ var solr_admin = function( app_config )
classes.push( 'default' );
}
- var core_tpl = '<li id="' + core_name + '" '
+ var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
+ ' class="' + classes.join( ' ' ) + '"'
+ ' data-basepath="' + core_path + '"'
+ ' schema="' + schema + '"'
diff --git a/solr/webapp/web/js/scripts/dashboard.js b/solr/webapp/web/js/scripts/dashboard.js
index 1bee7bc7833..d7d90820b03 100644
--- a/solr/webapp/web/js/scripts/dashboard.js
+++ b/solr/webapp/web/js/scripts/dashboard.js
@@ -39,7 +39,7 @@ var set_healthcheck_status = function( status )
// #/:core
sammy.get
(
- /^#\/([\w\d-]+)$/,
+ new RegExp( app.core_regex_base + '$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/dataimport.js b/solr/webapp/web/js/scripts/dataimport.js
index 7acb1ea84c1..8f0e183c5bc 100644
--- a/solr/webapp/web/js/scripts/dataimport.js
+++ b/solr/webapp/web/js/scripts/dataimport.js
@@ -101,7 +101,7 @@ sammy.bind
// #/:core/dataimport
sammy.get
(
- /^#\/([\w\d-]+)\/(dataimport)$/,
+ new RegExp( app.core_regex_base + '\\/(dataimport)$' ),
function( context )
{
sammy.trigger
@@ -129,7 +129,7 @@ sammy.get
// #/:core/dataimport
sammy.get
(
- /^#\/([\w\d-]+)\/(dataimport)\//,
+ new RegExp( app.core_regex_base + '\\/(dataimport)\\/' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/file.js b/solr/webapp/web/js/scripts/file.js
index 213c222e780..a1ff87763c8 100644
--- a/solr/webapp/web/js/scripts/file.js
+++ b/solr/webapp/web/js/scripts/file.js
@@ -18,7 +18,7 @@
// #/:core/schema, #/:core/config
sammy.get
(
- /^#\/([\w\d-]+)\/(schema|config)$/,
+ new RegExp( app.core_regex_base + '\\/(schema|config)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/plugins.js b/solr/webapp/web/js/scripts/plugins.js
index ad54bf771f5..f77d03dea14 100644
--- a/solr/webapp/web/js/scripts/plugins.js
+++ b/solr/webapp/web/js/scripts/plugins.js
@@ -382,7 +382,7 @@ sammy.bind
// #/:core/plugins/$type
sammy.get
(
- /^#\/([\w\d-]+)\/(plugins)\/(\w+)$/,
+ new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
@@ -405,7 +405,7 @@ sammy.get
// #/:core/plugins
sammy.get
(
- /^#\/([\w\d-]+)\/(plugins)$/,
+ new RegExp( app.core_regex_base + '\\/(plugins)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/query.js b/solr/webapp/web/js/scripts/query.js
index 559ce5595e6..eaa0b5d5d21 100644
--- a/solr/webapp/web/js/scripts/query.js
+++ b/solr/webapp/web/js/scripts/query.js
@@ -18,7 +18,7 @@
// #/:core/query
sammy.get
(
- /^#\/([\w\d-]+)\/(query)$/,
+ new RegExp( app.core_regex_base + '\\/(query)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/replication.js b/solr/webapp/web/js/scripts/replication.js
index 7d00d97f97f..c962c391f65 100644
--- a/solr/webapp/web/js/scripts/replication.js
+++ b/solr/webapp/web/js/scripts/replication.js
@@ -490,7 +490,7 @@ var replication_fetch_status = function()
// #/:core/replication
sammy.get
(
- /^#\/([\w\d-]+)\/(replication)$/,
+ new RegExp( app.core_regex_base + '\\/(replication)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
diff --git a/solr/webapp/web/js/scripts/schema-browser.js b/solr/webapp/web/js/scripts/schema-browser.js
index 7ecaceed9e2..0398c3ec161 100644
--- a/solr/webapp/web/js/scripts/schema-browser.js
+++ b/solr/webapp/web/js/scripts/schema-browser.js
@@ -678,7 +678,7 @@ sammy.bind
// #/:core/schema-browser
sammy.get
(
- /^#\/([\w\d-]+)\/(schema-browser)$/,
+ new RegExp( app.core_regex_base + '\\/(schema-browser)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );