summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-20 20:42:03 +0100
committerGitHub <noreply@github.com>2020-05-20 15:42:03 -0400
commitc83bc55b523251c0891a014155d0948f193e6f38 (patch)
tree38debc0193af14e6d44c36e671c1a4737549f833 /modules/setting
parent09cc6392f6320560e805bd50f99ccd85cda9319c (diff)
downloadgitea-c83bc55b523251c0891a014155d0948f193e6f38.tar.gz
gitea-c83bc55b523251c0891a014155d0948f193e6f38.zip
TrimSpace when reading InternalToken from a file (#11502) (#11524)
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> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index ede4687c81..9507d46930 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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)
}