checkMaxSize rejects a file over the limit for its kind. The limit is inclusive, so the message says at most rather than under.
(a asset, maxBytes int64, kind string)
| 160 | // checkMaxSize rejects a file over the limit for its kind. The limit is |
| 161 | // inclusive, so the message says at most rather than under. |
| 162 | func checkMaxSize(a asset, maxBytes int64, kind string) error { |
| 163 | if a.info.Size() <= maxBytes { |
| 164 | return nil |
| 165 | } |
| 166 | return fmt.Errorf("%s: %s must be at most %s", a.path, kind, text.FormatSize(maxBytes)) |
| 167 | } |
| 168 | |
| 169 | // supportedContentType maps a file extension to the content type the endpoint |
| 170 | // expects. The extension is all gh checks, since the endpoint accepts |
no test coverage detected