diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-12-15 14:59:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 14:59:57 +0800 |
commit | 4da1d9781025aa4a85899b1ddeb25aabbaa82703 (patch) | |
tree | 9714f71f2fb042e44d418fbcfc56cd8440a1bbb1 /routers/private/manager.go | |
parent | 9d943bf374e56e4d403303a6a2caafc1c79cdb6f (diff) | |
download | gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.tar.gz gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.zip |
Refactor HTTP request context (#17979)
Diffstat (limited to 'routers/private/manager.go')
-rw-r--r-- | routers/private/manager.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/private/manager.go b/routers/private/manager.go index 2b4cfb8ef4..a3b9a16f79 100644 --- a/routers/private/manager.go +++ b/routers/private/manager.go @@ -41,19 +41,19 @@ func FlushQueues(ctx *context.PrivateContext) { Err: fmt.Sprintf("%v", err), }) } - ctx.PlainText(http.StatusOK, []byte("success")) + ctx.PlainText(http.StatusOK, "success") } // PauseLogging pauses logging func PauseLogging(ctx *context.PrivateContext) { log.Pause() - ctx.PlainText(http.StatusOK, []byte("success")) + ctx.PlainText(http.StatusOK, "success") } // ResumeLogging resumes logging func ResumeLogging(ctx *context.PrivateContext) { log.Resume() - ctx.PlainText(http.StatusOK, []byte("success")) + ctx.PlainText(http.StatusOK, "success") } // ReleaseReopenLogging releases and reopens logging files @@ -64,7 +64,7 @@ func ReleaseReopenLogging(ctx *context.PrivateContext) { }) return } - ctx.PlainText(http.StatusOK, []byte("success")) + ctx.PlainText(http.StatusOK, "success") } // RemoveLogger removes a logger @@ -81,7 +81,7 @@ func RemoveLogger(ctx *context.PrivateContext) { if ok { setting.RemoveSubLogDescription(group, name) } - ctx.PlainText(http.StatusOK, []byte(fmt.Sprintf("Removed %s %s", group, name))) + ctx.PlainText(http.StatusOK, fmt.Sprintf("Removed %s %s", group, name)) } // AddLogger adds a logger @@ -154,5 +154,5 @@ func AddLogger(ctx *context.PrivateContext) { Config: config, }) - ctx.PlainText(http.StatusOK, []byte("success")) + ctx.PlainText(http.StatusOK, "success") } |