Skip to content

Content-Type: application/json is not set properly #4

Description

@xuxinx

Currently response text/plain, not application/json

What Golang rules:
https://github.com/golang/go/blob/9e277f7d554455e16ba3762541c53e9bfc1d8188/src/net/http/server.go#L94-L101

What jsonhandlerfunc do:

jsonhandlerfunc/handler.go

Lines 110 to 111 in cf20ea2

w.WriteHeader(httpCode)
writeJSONResponse(w, outs)

jsonhandlerfunc/handler.go

Lines 219 to 220 in cf20ea2

func writeJSONResponse(w http.ResponseWriter, out interface{}) {
w.Header().Set("Content-Type", "application/json")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions