Content-Type fixes in client4.ts and remote_cluster.go (#27887)
Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b94a11e591
Коммит
84a0c09d56
@@ -4179,7 +4179,11 @@ export default class Client4 {
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = await response.json();
|
||||
if (headers.get('Content-Type') === 'application/json') {
|
||||
data = await response.json();
|
||||
} else {
|
||||
data = await response.text();
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ClientError(this.getUrl(), {
|
||||
message: 'Received invalid response from the server.',
|
||||
|
||||
Ссылка в новой задаче
Block a user