Avoid copying the whole file into RAM to detect its content type
Avoid copying the whole file into RAM to detect its content type

request.buildHTTP copies the whole files into RAM to detect their
content types, but it increases RAM usage if there is a large file.
Since http.DetectContentType only considers at most the first 512 bytes
of data, we can avoid copying the whole data.

Signed-off-by: Junpei Kawamoto <144475b314ad7228bccae4b8a298b1d83ff9bcd0@gmail.com>

go-openapi/runtime,go-openapi/runtime