fix(response-body): show download button both for non-empty Blob and string responses (#9343)

Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>

Refs #9298
This commit is contained in:
Michał Korczak
2023-11-09 14:48:16 +01:00
committed by GitHub
parent 2a4afd94f6
commit f803fa3410
2 changed files with 16 additions and 8 deletions

View File

@@ -60,11 +60,11 @@ export default class ResponseBody extends React.PureComponent {
if (
(/^application\/octet-stream/i.test(contentType) ||
(headers["Content-Disposition"] && /attachment/i.test(headers["Content-Disposition"])) ||
(headers["content-disposition"] && /attachment/i.test(headers["content-disposition"])) ||
(headers["Content-Description"] && /File Transfer/i.test(headers["Content-Description"])) ||
(headers["content-description"] && /File Transfer/i.test(headers["content-description"]))) &&
content.size > 0
(headers["Content-Disposition"] && /attachment/i.test(headers["Content-Disposition"])) ||
(headers["content-disposition"] && /attachment/i.test(headers["content-disposition"])) ||
(headers["Content-Description"] && /File Transfer/i.test(headers["Content-Description"])) ||
(headers["content-description"] && /File Transfer/i.test(headers["content-description"]))) &&
(content.size > 0 || content.length > 0)
) {
// Download