Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
e65d8797
Commit
e65d8797
authored
Nov 24, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #940 from hilyjiang/develop
make Content-Type header more human-readable
parents
802aa161
db04c3cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
output.go
context/output.go
+3
-3
No files found.
context/output.go
View file @
e65d8797
...
@@ -188,7 +188,7 @@ func sanitizeValue(v string) string {
...
@@ -188,7 +188,7 @@ func sanitizeValue(v string) string {
// Json writes json to response body.
// Json writes json to response body.
// if coding is true, it converts utf-8 to \u0000 type.
// if coding is true, it converts utf-8 to \u0000 type.
func
(
output
*
BeegoOutput
)
Json
(
data
interface
{},
hasIndent
bool
,
coding
bool
)
error
{
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
content
[]
byte
var
err
error
var
err
error
if
hasIndent
{
if
hasIndent
{
...
@@ -209,7 +209,7 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e
...
@@ -209,7 +209,7 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e
// Jsonp writes jsonp to response body.
// Jsonp writes jsonp to response body.
func
(
output
*
BeegoOutput
)
Jsonp
(
data
interface
{},
hasIndent
bool
)
error
{
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
content
[]
byte
var
err
error
var
err
error
if
hasIndent
{
if
hasIndent
{
...
@@ -235,7 +235,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
...
@@ -235,7 +235,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
// Xml writes xml string to response body.
// Xml writes xml string to response body.
func
(
output
*
BeegoOutput
)
Xml
(
data
interface
{},
hasIndent
bool
)
error
{
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
content
[]
byte
var
err
error
var
err
error
if
hasIndent
{
if
hasIndent
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment