mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 22:01:44 +02:00
TrimSpace when reading InternalToken from a file (#11502)
InternalTokens are fixed as alphanum strings therefore TrimSpace from these. Also use isatty to not add a terminal newline when redirecting generate. Fix #11498 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
1 parent
0903b1ac8c
commit
c81ab17de9
2 files changed
+21
-4
No files matched your search
@@ -1069,7 +1069,7 @@ func loadInternalToken(sec *ini.Section) string {
|
||||
return token
|
||||
}
|
||||
|
||||
return string(buf)
|
||||
return strings.TrimSpace(string(buf))
|
||||
default:
|
||||
log.Fatal("Unsupported URI-Scheme %q (INTERNAL_TOKEN_URI = %q)", tempURI.Scheme, uri)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user