Skip to content

Commit cd4410d

Browse files
gerlowskijajanhoyclaude
authored
SOLR-18102: Fix Admin UI serving issue with basic auth (#4110)
Co-authored-by: Jan Høydahl <janhoy@apache.org> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a330e81 commit cd4410d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public static boolean shouldAudit(CoreContainer cores, AuditEvent.EventType even
602602
private boolean shouldAuthorize() {
603603
if (PublicKeyHandler.PATH.equals(path)) return false;
604604
// admin/info/key is the path where public key is exposed . it is always unsecured
605-
if ("/".equals(path) || "/solr/".equals(path))
605+
if (StrUtils.isNullOrEmpty(path) || "/".equals(path) || "/solr/".equals(path))
606606
return false; // Static Admin UI files must always be served
607607
if (cores.getPkiAuthenticationSecurityBuilder() != null && req.getUserPrincipal() != null) {
608608
boolean b = cores.getPkiAuthenticationSecurityBuilder().needsAuthorization(req);

solr/packaging/test/test_basic_auth.bats

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ run solr create -c COLL_NAME
9191
#assert_output --partial "Deployment successful"
9292
#refute_output --partial "Invalid collection"
9393
}
94+
95+
@test "admin UI static content is excepted from basic auth" {
96+
run curl -I -s http://localhost:${SOLR_PORT}/solr/
97+
assert_output --partial "HTTP/1.1 200"
98+
assert_output --partial "Content-Type: text/html"
99+
}

0 commit comments

Comments
 (0)