We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f87144 commit 3e71f10Copy full SHA for 3e71f10
upload/base.go
@@ -191,14 +191,15 @@ func (a *BaseClient) SetFieldMapping(fm map[string]string) Client {
191
}
192
193
func (a *BaseClient) Response() error {
194
- if a.Code > 0 {
195
- return a.responseContentType(a.Code)
196
- }
197
- return a.responseContentType(http.StatusOK)
+ return a.responseContentType()
198
199
200
-func (a *BaseClient) responseContentType(code int) error {
+func (a *BaseClient) responseContentType() error {
201
data := a.GetRespData()
+ code := a.Code
+ if code <= 0 {
+ code = http.StatusOK
202
+ }
203
switch a.ContentType {
204
case `string`:
205
return a.String(fmt.Sprint(data), code)
0 commit comments