(ct string)
| 129 | } |
| 130 | |
| 131 | func isBinaryContentType(ct string) bool { |
| 132 | ct = strings.ToLower(ct) |
| 133 | binaryPrefixes := []string{ |
| 134 | "application/octet-stream", |
| 135 | "application/zip", |
| 136 | "application/pdf", |
| 137 | "application/gzip", |
| 138 | "image/", |
| 139 | "audio/", |
| 140 | "video/", |
| 141 | } |
| 142 | for _, prefix := range binaryPrefixes { |
| 143 | if strings.HasPrefix(ct, prefix) { |
| 144 | return true |
| 145 | } |
| 146 | } |
| 147 | return false |
| 148 | } |