Skip to content

Commit e623895

Browse files
committed
fix: add content type sniff as fallback in client
1 parent 12a1f8e commit e623895

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/client/cmd/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ func upload(cmd *cobra.Command, r io.Reader, filename, source string, size int64
8888
head = head[:n]
8989
if looksLikeText(head) {
9090
contentType = "text/plain; charset=utf-8"
91+
} else {
92+
contentType = http.DetectContentType(head)
9193
}
9294
r = io.MultiReader(bytes.NewReader(head), r)
9395
}

0 commit comments

Comments
 (0)