Skip to content

Commit 8dfd55f

Browse files
committed
Remove unnecessary PlainText
1 parent 1cc4859 commit 8dfd55f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

modules/context/context.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333

3434
"gitea.com/go-chi/cache"
3535
"gitea.com/go-chi/session"
36-
chi "github.com/go-chi/chi/v5"
3736
"github.com/unknwon/com"
3837
"github.com/unknwon/i18n"
3938
"github.com/unrolled/render"
@@ -50,7 +49,7 @@ type Render interface {
5049
type Context struct {
5150
*BaseContext
5251
PageData map[string]interface{} // data used by JavaScript modules in one page, it's `window.config.pageData`
53-
Render Render
52+
Render Render
5453
translation.Locale
5554
Cache cache.Cache
5655
csrf CSRF
@@ -317,16 +316,6 @@ func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interfa
317316
http.ServeContent(ctx.Resp, ctx.Req, name, modtime, r)
318317
}
319318

320-
// PlainText render content as plain text, this will override basecontext's method
321-
// because we need a beautiful failed page
322-
func (ctx *Context) PlainText(status int, bs []byte) {
323-
ctx.Resp.WriteHeader(status)
324-
ctx.Resp.Header().Set("Content-Type", "text/plain;charset=utf-8")
325-
if _, err := ctx.Resp.Write(bs); err != nil {
326-
ctx.ServerError("Write bytes failed", err)
327-
}
328-
}
329-
330319
// ServeStream serves file via io stream
331320
func (ctx *Context) ServeStream(rd io.Reader, name string) {
332321
ctx.Resp.Header().Set("Content-Description", "File Transfer")

0 commit comments

Comments
 (0)