Monorepo for Tangled tangled.org

appview,hook,knotserver: set charset=utf-8 for all text/plain responses

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

anirudh.fi 7cf6a47c 2762da91

verified
Changed files
+4 -4
appview
pulls
repo
hook
knotserver
+1 -1
appview/pulls/pulls.go
··· 447 447 } 448 448 } 449 449 450 - w.Header().Set("Content-Type", "text/plain") 450 + w.Header().Set("Content-Type", "text/plain; charset=utf-8") 451 451 w.Write([]byte(pull.Submissions[roundIdInt].Patch)) 452 452 } 453 453
+1 -1
appview/repo/repo.go
··· 590 590 return 591 591 } 592 592 593 - w.Header().Set("Content-Type", "text/plain") 593 + w.Header().Set("Content-Type", "text/plain; charset=utf-8") 594 594 w.Write([]byte(result.Contents)) 595 595 return 596 596 }
+1 -1
hook/hook.go
··· 63 63 return fmt.Errorf("failed to create request: %w", err) 64 64 } 65 65 66 - req.Header.Set("Content-Type", "text/plain") 66 + req.Header.Set("Content-Type", "text/plain; charset=utf-8") 67 67 req.Header.Set("X-Git-Dir", gitDir) 68 68 req.Header.Set("X-Git-User-Did", userDid) 69 69 req.Header.Set("X-Git-User-Handle", userHandle)
+1 -1
knotserver/handler.go
··· 187 187 } 188 188 } 189 189 190 - w.Header().Set("Content-Type", "text/plain") 190 + w.Header().Set("Content-Type", "text/plain; charset=utf-8") 191 191 fmt.Fprintf(w, "knotserver/%s", version) 192 192 }