<commit_before>package cion

import (
	"encoding/json"
	"github.com/zenazn/goji/web"
	"log"
	"net/http"
	"strconv"
)

func NewJobHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	branch := c.URLParams["branch"]

	j := NewJob(owner, repo, branch, "")
	if err := js.Save(j); err != nil {
		log.Println("error saving job:", err)
	}

	jr := &JobRequest{
		Job:      j,
		Executor: e,
		Store:    js,
	}

	go jr.Run()

	w.Header().Set("Content-Type", "application/json")
	b, _ := json.MarshalIndent(j, "", "\t")
	w.Write(b)
}

func GetJobHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	number, _ := strconv.ParseUint(c.URLParams["number"], 0, 64)

	j, err := js.GetByNumber(owner, repo, number)
	if err != nil {
		log.Println("error getting job:", err)
	}

	w.Header().Set("Content-Type", "application/json")
	b, _ := json.MarshalIndent(j, "", "\t")
	w.Write(b)
}

func GetLogHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	number, _ := strconv.ParseUint(c.URLParams["number"], 0, 64)

	j, err := js.GetByNumber(owner, repo, number)
	if err != nil {
		log.Println("error getting job:", err)
	}

	w.Header().Set("Content-Type", "application/json")
	if _, err := js.GetLogger(j).WriteTo(w); err != nil {
		log.Println("error getting job logs:", err)
	}
}
<commit_msg>Use the correct Content-Type for logs<commit_after>package cion

import (
	"encoding/json"
	"github.com/zenazn/goji/web"
	"log"
	"net/http"
	"strconv"
)

func NewJobHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	branch := c.URLParams["branch"]

	j := NewJob(owner, repo, branch, "")
	if err := js.Save(j); err != nil {
		log.Println("error saving job:", err)
	}

	jr := &JobRequest{
		Job:      j,
		Executor: e,
		Store:    js,
	}

	go jr.Run()

	w.Header().Set("Content-Type", "application/json")
	b, _ := json.MarshalIndent(j, "", "\t")
	w.Write(b)
}

func GetJobHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	number, _ := strconv.ParseUint(c.URLParams["number"], 0, 64)

	j, err := js.GetByNumber(owner, repo, number)
	if err != nil {
		log.Println("error getting job:", err)
	}

	w.Header().Set("Content-Type", "application/json")
	b, _ := json.MarshalIndent(j, "", "\t")
	w.Write(b)
}

func GetLogHandler(c web.C, w http.ResponseWriter, r *http.Request) {
	owner := c.URLParams["owner"]
	repo := c.URLParams["repo"]
	number, _ := strconv.ParseUint(c.URLParams["number"], 0, 64)

	j, err := js.GetByNumber(owner, repo, number)
	if err != nil {
		log.Println("error getting job:", err)
	}

	w.Header().Set("Content-Type", "text/plain")
	if _, err := js.GetLogger(j).WriteTo(w); err != nil {
		log.Println("error getting job logs:", err)
	}
}

{'fraction_non_alphanumeric': 0.19993256911665544, 'fraction_numerical': 0.004045853000674309, 'mean_word_length': 4.037351443123939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2411794', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1151, 'n_words': 249}