diff --git a/server/handler/badge.go b/server/handler/badge.go index 173e3846..3dcd6229 100644 --- a/server/handler/badge.go +++ b/server/handler/badge.go @@ -113,6 +113,8 @@ func GetCC(c web.C, w http.ResponseWriter, r *http.Request) { name = c.URLParams["name"] ) + w.Header().Set("Content-Type", "application/xml") + repo, err := datastore.GetRepoName(ctx, host, owner, name) if err != nil { w.WriteHeader(http.StatusNotFound) diff --git a/server/handler/login.go b/server/handler/login.go index 2ae13603..2b188bea 100644 --- a/server/handler/login.go +++ b/server/handler/login.go @@ -30,6 +30,8 @@ func GetLogin(c web.C, w http.ResponseWriter, r *http.Request) { return } + w.Header().Del("Content-Type") + // authenticate the user login, err := remote.Authorize(w, r) if err != nil { diff --git a/server/handler/output.go b/server/handler/output.go index 21a1e037..28cca8d1 100644 --- a/server/handler/output.go +++ b/server/handler/output.go @@ -24,6 +24,8 @@ func GetOutput(c web.C, w http.ResponseWriter, r *http.Request) { hash = c.URLParams["commit"] ) + w.Header().Set("Content-Type", "text/plain") + path := filepath.Join(host, owner, name, branch, hash) rc, err := blobstore.GetReader(ctx, path) if err != nil { diff --git a/server/middleware/options.go b/server/middleware/options.go index 42aefc77..24a78902 100644 --- a/server/middleware/options.go +++ b/server/middleware/options.go @@ -15,6 +15,7 @@ func Options(c *web.C, h http.Handler) http.Handler { w.Header().Set("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Authorization") w.Header().Set("Allow", "HEAD,GET,POST,PUT,DELETE,OPTIONS") + w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) return }