Fix API broken
This commit is contained in:
parent
9e3a1bc11a
commit
3abc41ccca
10 changed files with 12 additions and 10 deletions
|
@ -5,7 +5,6 @@
|
|||
package v1
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/gogits/gogs/modules/auth/apiv1"
|
||||
|
@ -34,7 +33,7 @@ func Markdown(ctx *middleware.Context, form apiv1.MarkdownForm) {
|
|||
|
||||
// Render a Markdown document in raw mode.
|
||||
func MarkdownRaw(ctx *middleware.Context) {
|
||||
body, err := ioutil.ReadAll(ctx.Req.Body)
|
||||
body, err := ctx.Req.Body().Bytes()
|
||||
if err != nil {
|
||||
ctx.JSON(422, base.ApiJsonErr{err.Error(), DOC_URL})
|
||||
return
|
||||
|
|
|
@ -229,6 +229,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
|||
setting.Cfg.SetValue("log", "MODE", "file")
|
||||
|
||||
setting.Cfg.SetValue("security", "INSTALL_LOCK", "true")
|
||||
setting.Cfg.SetValue("security", "SECRET_KEY", base.GetRandomString(15))
|
||||
|
||||
os.MkdirAll("custom/conf", os.ModePerm)
|
||||
if err := goconfig.SaveConfigFile(setting.Cfg, path.Join(setting.CustomPath, "conf/app.ini")); err != nil {
|
||||
|
|
|
@ -204,7 +204,7 @@ func Http(ctx *middleware.Context) {
|
|||
config := Config{setting.RepoRootPath, "git", true, true, f}
|
||||
|
||||
handler := HttpBackend(&config)
|
||||
handler(ctx.Resp, ctx.Req)
|
||||
handler(ctx.Resp, ctx.Req.Request)
|
||||
}
|
||||
|
||||
type route struct {
|
||||
|
|
|
@ -229,7 +229,7 @@ func SignUpPost(ctx *middleware.Context, cpt *captcha.Captcha, form auth.Registe
|
|||
return
|
||||
}
|
||||
|
||||
if !cpt.VerifyReq(ctx.Req) {
|
||||
if !cpt.VerifyReq(ctx.Req.Request) {
|
||||
ctx.Data["Err_Captcha"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("form.captcha_incorrect"), SIGNUP, &form)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue