<commit_before>package middlewares

import (
	"../config"
	"encoding/base64"
	"net/http"
	"strings"
)

func PlainText(h http.Handler) http.Handler {
	handler := func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "text/plain")
		h.ServeHTTP(w, r)
	}
	return http.HandlerFunc(handler)
}

func Secure(h http.Handler) http.Handler {
	handler := func(w http.ResponseWriter, r *http.Request) {
		auth := r.Header.Get("Authorization") // Basic dXJAKLRYHA
		if !strings.HasPrefix(auth, "Basic") || len(auth) == 0 {
			forceAuth(w)<commit_msg>added json middleware<commit_after>package middlewares

import (
	"../config"
	"encoding/base64"
	"net/http"
	"strings"
)

func PlainText(h http.Handler) http.Handler {
	handler := func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "text/plain")
		h.ServeHTTP(w, r)
	}
	return http.HandlerFunc(handler)
}

func JSON(h http.Handler) http.Handler {
	handler := func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Content-Type", "application/json")
		h.ServeHTTP(w, r)
	}
	return http.HandlerFunc(handler)
}

func Secure(h http.Handler) http.Handler {
	handler := func(w http.ResponseWriter, r *http.Request) {
		auth := r.Header.Get("Authorization") // Basic dXJAKLRYHA
		if !strings.HasPrefix(auth, "Basic") || len(auth) == 0 {
			forceAuth(w)
{'fraction_non_alphanumeric': 0.16629547141796586, 'fraction_numerical': 0.004454342984409799, 'mean_word_length': 4.5473251028806585, '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': '5505066', 'n_tokens_mistral': 515, 'n_tokens_neox': 491, 'n_words': 98}