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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2013-01-05 10:57:21 +00:00
parent 65a9cc3643
commit 8172b5d535
10 changed files with 16 additions and 12 deletions

View File

@ -445,6 +445,8 @@ Bug Fixes
* SOLR-4257: PeerSync updates and Log Replay updates should not wait for * SOLR-4257: PeerSync updates and Log Replay updates should not wait for
a ZooKeeper connection in order to proceed. (yonik) 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 Other Changes
---------------------- ----------------------

View File

@ -18,7 +18,7 @@
// #/:core/analysis // #/:core/analysis
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(analysis)$/, new RegExp( app.core_regex_base + '\\/(analysis)$' ),
function( context ) function( context )
{ {
var active_core = this.active_core; var active_core = this.active_core;

View File

@ -100,7 +100,7 @@ var sammy = $.sammy
{ {
var selector = '~' === this.params.splat[0][0] var selector = '~' === this.params.splat[0][0]
? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global' ? '#' + 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 ); var active_element = $( selector, menu_wrapper );
@ -152,6 +152,8 @@ var solr_admin = function( app_config )
this.timeout = null; this.timeout = null;
this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
show_global_error = function( error ) show_global_error = function( error )
{ {
var main = $( '#main' ); var main = $( '#main' );
@ -205,7 +207,7 @@ var solr_admin = function( app_config )
classes.push( 'default' ); classes.push( 'default' );
} }
var core_tpl = '<li id="' + core_name + '" ' var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
+ ' class="' + classes.join( ' ' ) + '"' + ' class="' + classes.join( ' ' ) + '"'
+ ' data-basepath="' + core_path + '"' + ' data-basepath="' + core_path + '"'
+ ' schema="' + schema + '"' + ' schema="' + schema + '"'

View File

@ -39,7 +39,7 @@ var set_healthcheck_status = function( status )
// #/:core // #/:core
sammy.get sammy.get
( (
/^#\/([\w\d-]+)$/, new RegExp( app.core_regex_base + '$' ),
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -101,7 +101,7 @@ sammy.bind
// #/:core/dataimport // #/:core/dataimport
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(dataimport)$/, new RegExp( app.core_regex_base + '\\/(dataimport)$' ),
function( context ) function( context )
{ {
sammy.trigger sammy.trigger
@ -129,7 +129,7 @@ sammy.get
// #/:core/dataimport // #/:core/dataimport
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(dataimport)\//, new RegExp( app.core_regex_base + '\\/(dataimport)\\/' ),
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -18,7 +18,7 @@
// #/:core/schema, #/:core/config // #/:core/schema, #/:core/config
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(schema|config)$/, new RegExp( app.core_regex_base + '\\/(schema|config)$' ),
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -382,7 +382,7 @@ sammy.bind
// #/:core/plugins/$type // #/:core/plugins/$type
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(plugins)\/(\w+)$/, new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
function( context ) function( context )
{ {
core_basepath = this.active_core.attr( 'data-basepath' ); core_basepath = this.active_core.attr( 'data-basepath' );
@ -405,7 +405,7 @@ sammy.get
// #/:core/plugins // #/:core/plugins
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(plugins)$/, new RegExp( app.core_regex_base + '\\/(plugins)$' ),
function( context ) function( context )
{ {
core_basepath = this.active_core.attr( 'data-basepath' ); core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -18,7 +18,7 @@
// #/:core/query // #/:core/query
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(query)$/, new RegExp( app.core_regex_base + '\\/(query)$' ),
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -490,7 +490,7 @@ var replication_fetch_status = function()
// #/:core/replication // #/:core/replication
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(replication)$/, new RegExp( app.core_regex_base + '\\/(replication)$' ),
function( context ) function( context )
{ {
core_basepath = this.active_core.attr( 'data-basepath' ); core_basepath = this.active_core.attr( 'data-basepath' );

View File

@ -678,7 +678,7 @@ sammy.bind
// #/:core/schema-browser // #/:core/schema-browser
sammy.get sammy.get
( (
/^#\/([\w\d-]+)\/(schema-browser)$/, new RegExp( app.core_regex_base + '\\/(schema-browser)$' ),
function( context ) function( context )
{ {
var core_basepath = this.active_core.attr( 'data-basepath' ); var core_basepath = this.active_core.attr( 'data-basepath' );