Skip to content

Commit

Permalink
fix #897
Browse files Browse the repository at this point in the history
  • Loading branch information
kataras committed Feb 3, 2018
1 parent c56b7a3 commit 21cb572
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _examples/experimental-handlers/csrf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func getSignupForm(ctx iris.Context) {
ctx.ViewData(csrf.TemplateTag, csrf.TemplateField(ctx))
ctx.View("user/signup.html")

// We could also retrieve the token directly from csrf.Token(r) and
// We could also retrieve the token directly from csrf.Token(ctx) and
// set it in the request header - ctx.GetHeader("X-CSRF-Token", token)
// This is useful if you're sending JSON to clients or a front-end JavaScript
// framework.
Expand Down
4 changes: 2 additions & 2 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1553,8 +1553,7 @@ func (ctx *context) ContentType(cType string) {
// if doesn't contain a charset already then append it
if !strings.Contains(cType, "charset") {
if cType != ContentBinaryHeaderValue {
charset := ctx.Application().ConfigurationReadOnly().GetCharset()
cType += "; charset=" + charset
cType += "; charset=" + ctx.Application().ConfigurationReadOnly().GetCharset()
}
}

Expand Down Expand Up @@ -1940,6 +1939,7 @@ func (ctx *context) UploadFormFiles(destDirectory string, before ...func(Context
n += n0
}
}
return n, nil
}
}

Expand Down

0 comments on commit 21cb572

Please sign in to comment.