mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-29 17:46:16 +01:00
Bugfix for go-git client issue
This commit is contained in:
committed by
René Pfeuffer
parent
59a9d4939a
commit
7858316a63
@@ -69,7 +69,12 @@ public class GitUserAgentProvider implements UserAgentProvider {
|
||||
.basicAuthenticationCharset(Charsets.UTF_8)
|
||||
.build();
|
||||
|
||||
private static final String PREFIX_GOGIT = "go-git/";
|
||||
|
||||
@VisibleForTesting
|
||||
static final UserAgent GOGIT = UserAgent.scmClient("go-git")
|
||||
.basicAuthenticationCharset(Charsets.UTF_8)
|
||||
.build();
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -85,6 +90,8 @@ public class GitUserAgentProvider implements UserAgentProvider {
|
||||
return GIT_LFS;
|
||||
} else if (isGit(lowerUserAgent)) {
|
||||
return GIT;
|
||||
} else if (isGoGit(lowerUserAgent)) {
|
||||
return GOGIT;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -109,4 +116,6 @@ public class GitUserAgentProvider implements UserAgentProvider {
|
||||
private boolean isGit(String userAgent) {
|
||||
return userAgent.startsWith(PREFIX_REGULAR);
|
||||
}
|
||||
|
||||
private boolean isGoGit(String userAgent) { return userAgent.startsWith(PREFIX_GOGIT); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user