mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
fix bug with passwords which contains a colon
This commit is contained in:
@@ -242,14 +242,25 @@ public class HgHookCallbackServlet extends HttpServlet
|
||||
|
||||
if (Util.isNotEmpty(credentials))
|
||||
{
|
||||
String[] credentialsArray = credentials.split(":");
|
||||
int index = credentials.indexOf(':');
|
||||
|
||||
if (credentialsArray.length >= 2)
|
||||
if (index > 0 && index < credentials.length())
|
||||
{
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
|
||||
subject.login(Tokens.createAuthenticationToken(request,
|
||||
credentialsArray[0], credentialsArray[1]));
|
||||
//J-
|
||||
subject.login(
|
||||
Tokens.createAuthenticationToken(
|
||||
request,
|
||||
credentials.substring(0, index),
|
||||
credentials.substring(index + 1)
|
||||
)
|
||||
);
|
||||
//J+
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.error("could not find delimiter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user