1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fixed review comments

This commit is contained in:
Cromefire_ 2020-05-26 23:59:58 +02:00
parent 587b537cd6
commit 6d14ad0a76
No known key found for this signature in database
GPG key ID: D3D3DB179F435F0C
3 changed files with 8 additions and 7 deletions

View file

@ -77,6 +77,7 @@
function paramsToString(params) {
return Object.keys(params)
.filter((k) => !!params[k])
.map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`)
.join('&');
}
@ -95,7 +96,7 @@
if (response.status < 400) {
if (request.dataType === 'json' || request.headers.accept === 'application/json') {
return response.json();
} else if (request.dataType === 'text' || (response.headers.get('Content-Type') || '').toLowerCase().includes('text/')) {
} else if (request.dataType === 'text' || (response.headers.get('Content-Type') || '').toLowerCase().startsWith('text/')) {
return response.text();
} else {
return response;