Fix header detection introduced in ae6d11c
Tested:
go install github.com/google/slothfs/cmd/slothfs-expand-manifest && slothfs-expand-manifest --gitiles https://android.googlesource.com/
Change-Id: I2b5c16416d7f3ff8da3b97b0352252a372335d28
diff --git a/fs/gitilesfs_test.go b/fs/gitilesfs_test.go
index b57613d..1deadf0 100644
--- a/fs/gitilesfs_test.go
+++ b/fs/gitilesfs_test.go
@@ -180,7 +180,7 @@
out := []byte(resp)
if strings.Contains(r.URL.String(), "format=TEXT") {
- w.Header().Set("Content-Type", "text/html; charset=UTF-8")
+ w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
str := base64.StdEncoding.EncodeToString(out)
w.Write([]byte(str))
} else {
diff --git a/gitiles/client.go b/gitiles/client.go
index 6dfd0bd..27a04fd 100644
--- a/gitiles/client.go
+++ b/gitiles/client.go
@@ -87,7 +87,7 @@
return nil, err
}
- if resp.Header.Get("Content-Type") == "text/html; charset=UTF-8" {
+ if resp.Header.Get("Content-Type") == "text/plain; charset=UTF-8" {
out := make([]byte, base64.StdEncoding.DecodedLen(len(c)))
n, err := base64.StdEncoding.Decode(out, c)
return out[:n], err