mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +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))
|
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 subject = SecurityUtils.getSubject();
|
||||||
|
|
||||||
subject.login(Tokens.createAuthenticationToken(request,
|
//J-
|
||||||
credentialsArray[0], credentialsArray[1]));
|
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