Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
db04c3cb
authored
2014-11-24 23:12:09 +0800
by
Hily Jiang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
make Content-Type header more human-readable
1 parent
802aa161
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
context/output.go
context/output.go
View file @
db04c3c
...
...
@@ -188,7 +188,7 @@ func sanitizeValue(v string) string {
// Json writes json to response body.
// if coding is true, it converts utf-8 to \u0000 type.
func
(
output
*
BeegoOutput
)
Json
(
data
interface
{},
hasIndent
bool
,
coding
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/json;
charset=UTF
-8"
)
output
.
Header
(
"Content-Type"
,
"application/json;
charset=utf
-8"
)
var
content
[]
byte
var
err
error
if
hasIndent
{
...
...
@@ -209,7 +209,7 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e
// Jsonp writes jsonp to response body.
func
(
output
*
BeegoOutput
)
Jsonp
(
data
interface
{},
hasIndent
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/javascript;
charset=UTF
-8"
)
output
.
Header
(
"Content-Type"
,
"application/javascript;
charset=utf
-8"
)
var
content
[]
byte
var
err
error
if
hasIndent
{
...
...
@@ -235,7 +235,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
// Xml writes xml string to response body.
func
(
output
*
BeegoOutput
)
Xml
(
data
interface
{},
hasIndent
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/xml;
charset=UTF
-8"
)
output
.
Header
(
"Content-Type"
,
"application/xml;
charset=utf
-8"
)
var
content
[]
byte
var
err
error
if
hasIndent
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment