<commit_before>package interfaces

import (
	"encoding/json"
	"fmt"
	"github.com/iaas-engine/domain"
	"io"
	"log"
	"net/http"
)

type EngineInteractor interface {
	CreateConf(server domain.Server, zipFile io.Writer)
}

type WebServiceHandler struct {
	EngineInteractor EngineInteractor
}

func (handler WebServiceHandler) CreateConfig(res http.ResponseWriter, req *http.Request) {
	defer req.Body.Close()

	decoder := json.NewDecoder(req.Body)
	mainJSON := domain.Myjson{}
	if e := decoder.Decode(&mainJSON); e != nil {
		log.Fatal(e)
	}

	server := domain.Server{}
	server = mainJSON.Server

	res.Header().Set("Content-Type", "application/zip")
	res.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", "algo"))
	handler.EngineInteractor.CreateConf(server, res)

}<commit_msg>Renaming zip file for download<commit_after>package interfaces

import (
	"encoding/json"
	"fmt"
	"github.com/iaas-engine/domain"
	"io"
	"log"
	"net/http"
)

type EngineInteractor interface {
	CreateConf(server domain.Server, zipFile io.Writer)
}

type WebServiceHandler struct {
	EngineInteractor EngineInteractor
}

func (handler WebServiceHandler) CreateConfig(res http.ResponseWriter, req *http.Request) {
	defer req.Body.Close()

	decoder := json.NewDecoder(req.Body)
	mainJSON := domain.Myjson{}
	if e := decoder.Decode(&mainJSON); e != nil {
		log.Fatal(e)
	}

	server := domain.Server{}
	server = mainJSON.Server

	res.Header().Set("Content-Type", "application/zip")
	res.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", "puppet.zip"))
	handler.EngineInteractor.CreateConf(server, res)

}
{'fraction_non_alphanumeric': 0.14917127071823205, 'fraction_numerical': 0.0, 'mean_word_length': 5.317829457364341, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6768330', 'n_tokens_mistral': 560, 'n_tokens_neox': 541, 'n_words': 108}