refactor - pasdns can now look sane

This commit is contained in:
amy 2024-07-15 21:54:27 +03:30
parent cc8322f221
commit 0be492aa87
7 changed files with 97 additions and 31 deletions

View file

@ -7,11 +7,11 @@ import (
"exhq.dev/pas/src/Constants"
)
func IntentGenerator(status Constants.Response, headers map[string]string) string {
func IntentGenerator(res Constants.Response) string {
headersString := ""
for key, value := range headers {
for key, value := range res.ResponseHeader {
headersString += fmt.Sprintf("%s:%s\n", key, value)
}
headersString = strings.TrimSuffix(headersString, "\n")
return fmt.Sprintf("PAS %s\n%s\n\n", string(status), headersString)
return fmt.Sprintf("PAS %s\n%s\n\n%s", string(res.OperationSuccessClassification), headersString, res.Body)
}