Skip to content

Commit a15770b

Browse files
committed
fixes #1021 - for content-type value such as application/gzip;charset=UTF-8 only consider the part before semicolon
1 parent e3a30a9 commit a15770b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/api-request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ export default class ApiRequest extends LitElement {
14971497
respHeadersObj[hdr] = hdrVal;
14981498
this.responseHeaders = `${this.responseHeaders}${hdr}: ${hdrVal}\n`;
14991499
});
1500-
const contentType = fetchResponse.headers.get('content-type');
1500+
const contentType = fetchResponse.headers.get('content-type').split(';')[0].trim();;
15011501
const respEmpty = (await fetchResponse.clone().text()).length === 0;
15021502
if (respEmpty) {
15031503
this.responseText = '';

0 commit comments

Comments
 (0)