Skip to content

Commit

Permalink
optimize api content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Nov 6, 2023
1 parent d389e5c commit a198120
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/qiniu/storage/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,12 @@ public StringMap getHeader() throws QiniuException {
header.put(key, this.header.get(key));
}

if (header.keySet().contains("Content-Type")) {
if (body == null || body.contentType == null
|| header.keySet().contains("Content-Type")) {
return header;
}

if (body != null) {
header.put("Content-Type", body.contentType.toString());
}
header.put("Content-Type", body.contentType.toString());

return header;
}
Expand Down

0 comments on commit a198120

Please sign in to comment.