Skip to content

Commit 3e71f10

Browse files
committed
fix
1 parent 1f87144 commit 3e71f10

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

upload/base.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,15 @@ func (a *BaseClient) SetFieldMapping(fm map[string]string) Client {
191191
}
192192

193193
func (a *BaseClient) Response() error {
194-
if a.Code > 0 {
195-
return a.responseContentType(a.Code)
196-
}
197-
return a.responseContentType(http.StatusOK)
194+
return a.responseContentType()
198195
}
199196

200-
func (a *BaseClient) responseContentType(code int) error {
197+
func (a *BaseClient) responseContentType() error {
201198
data := a.GetRespData()
199+
code := a.Code
200+
if code <= 0 {
201+
code = http.StatusOK
202+
}
202203
switch a.ContentType {
203204
case `string`:
204205
return a.String(fmt.Sprint(data), code)

0 commit comments

Comments
 (0)