FIX: uses localized string for 429 in reports (#6302)

NGINX was retuning an html page instead of single string for some users. Seems safer to not risk showing anything from server anyways.
This commit is contained in:
Joffrey JAFFEUX
2018-08-22 18:13:29 +02:00
committed by GitHub
parent c08dea386b
commit a48059fd8f
2 changed files with 5 additions and 5 deletions

View File

@ -318,11 +318,10 @@ export default Ember.Component.extend({
})
.catch(data => {
if (data.jqXHR && data.jqXHR.status === 429) {
const error = data.jqXHR.responseJSON
? data.jqXHR.responseJSON.errors[0]
: data.jqXHR.responseText;
this.set("rateLimitationString", error);
this.set(
"rateLimitationString",
I18n.t("admin.dashboard.too_many_requests")
);
}
})
.finally(() => {