summaryrefslogtreecommitdiffstats
path: root/models/repo_unit.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-07-22 15:24:21 +0100
committerGitHub <noreply@github.com>2021-07-22 17:24:21 +0300
commit0b06b2019f3b09f44c1cb045b90cd6a0ab649b1b (patch)
tree6a716cfb9da7f108051447887bd2f9fd6124e305 /models/repo_unit.go
parent057205a4b7c3aab8c75525e92678123f84ca88b1 (diff)
downloadgitea-1.15.0-rc2.tar.gz
gitea-1.15.0-rc2.zip
Add basic edit ldap auth test & actually fix #16252 (#16465) (#16494)v1.15.0-rc2
Backport #16465 One of the reasons why #16447 was needed and why #16268 was needed in the first place was because it appears that editing ldap configuration doesn't get tested. This PR therefore adds a basic test that will run the edit pipeline. In doing so it's now clear that #16447 and #16268 aren't actually solving #16252. It turns out that what actually happens is that is that the bytes are actually double encoded. This PR now changes the json unmarshal wrapper to handle this double encode. Fix #16252 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r--models/repo_unit.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go
index a12e056a7d..f430e4f7f3 100644
--- a/models/repo_unit.go
+++ b/models/repo_unit.go
@@ -28,7 +28,7 @@ type UnitConfig struct{}
// FromDB fills up a UnitConfig from serialized format.
func (cfg *UnitConfig) FromDB(bs []byte) error {
- return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
+ return jsonUnmarshalHandleDoubleEncode(bs, &cfg)
}
// ToDB exports a UnitConfig to a serialized format.
@@ -44,7 +44,7 @@ type ExternalWikiConfig struct {
// FromDB fills up a ExternalWikiConfig from serialized format.
func (cfg *ExternalWikiConfig) FromDB(bs []byte) error {
- return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
+ return jsonUnmarshalHandleDoubleEncode(bs, &cfg)
}
// ToDB exports a ExternalWikiConfig to a serialized format.
@@ -62,7 +62,7 @@ type ExternalTrackerConfig struct {
// FromDB fills up a ExternalTrackerConfig from serialized format.
func (cfg *ExternalTrackerConfig) FromDB(bs []byte) error {
- return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
+ return jsonUnmarshalHandleDoubleEncode(bs, &cfg)
}
// ToDB exports a ExternalTrackerConfig to a serialized format.
@@ -80,7 +80,7 @@ type IssuesConfig struct {
// FromDB fills up a IssuesConfig from serialized format.
func (cfg *IssuesConfig) FromDB(bs []byte) error {
- return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
+ return jsonUnmarshalHandleDoubleEncode(bs, &cfg)
}
// ToDB exports a IssuesConfig to a serialized format.
@@ -104,7 +104,7 @@ type PullRequestsConfig struct {
// FromDB fills up a PullRequestsConfig from serialized format.
func (cfg *PullRequestsConfig) FromDB(bs []byte) error {
- return jsonUnmarshalIgnoreErroneousBOM(bs, &cfg)
+ return jsonUnmarshalHandleDoubleEncode(bs, &cfg)
}
// ToDB exports a PullRequestsConfig to a serialized format.