Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying a content type #262

Merged
merged 1 commit into from Apr 18, 2023
Merged

Conversation

jkawamoto
Copy link
Contributor

Currently, the content type header for a multipart file is automatically detected with http.DetectContentType. However, sometimes we need to specify a custom content type.

This PR provides a simple way to pass a custom content type. If the given NamedReadCloser also has a function ContentType() string, the returned value will be used.

Currently, the content type header for a multipart file is
automatically detected with `http.DetectContentType`.
However, sometimes we need to specify a custom content type.

This commit provides a simple way to pass a custom content type.
If the given `NamedReadCloser` also has a function
`ContentType() string`, the returned value will be used.

Signed-off-by: Junpei Kawamoto <kawamoto.junpei@gmail.com>
@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Merging #262 (6fd2750) into master (93d335a) will increase coverage by 0.05%.
The diff coverage is 68.42%.

@@            Coverage Diff             @@
##           master     #262      +/-   ##
==========================================
+ Coverage   80.20%   80.26%   +0.05%     
==========================================
  Files          44       44              
  Lines        3350     3350              
==========================================
+ Hits         2687     2689       +2     
+ Misses        548      546       -2     
  Partials      115      115              
Impacted Files Coverage Δ
client/opentelemetry.go 93.04% <ø> (+1.59%) ⬆️
client_request.go 26.19% <0.00%> (ø)
client/request.go 67.01% <68.75%> (+0.46%) ⬆️
client/keepalive.go 64.00% <100.00%> (ø)
client/runtime.go 61.90% <100.00%> (-0.26%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@casualjim casualjim merged commit bc66442 into go-openapi:master Apr 18, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants