Skip to content

Commit

Permalink
fix(deck): Add check for isZeroLengthText response
Browse files Browse the repository at this point in the history
Ran into an issue when saving pipelines where I would submit a request
to save and the response coming back had a Content-Type of text/plain
which would cause the request to "fail" regardless of if it actually
succeeded or not. Adds a check to allow zero length text plain headers
as well.
  • Loading branch information
Ethan Rogers authored and anotherchrisberry committed Apr 28, 2017
1 parent 078fb11 commit 3fa8c34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/scripts/modules/core/api/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export class Api {
if (contentType) {
const isJson = contentType.includes('application/json');
const isZeroLengthHtml = (contentType.includes('text/html') && (result.data === ''));
if (!(isJson || isZeroLengthHtml)) {
const isZeroLengthText = (contentType.includes('text/plain') && (result.data === ''));
if (!(isJson || isZeroLengthHtml || isZeroLengthText)) {
this.authenticationIntializer.reauthenticateUser();
reject(result);
}
Expand Down

0 comments on commit 3fa8c34

Please sign in to comment.