Skip to content

Commit

Permalink
Update MiniBrowserEndpoint.defaultHandler() response to return conten…
Browse files Browse the repository at this point in the history
…t when file type is not exists at mime-db

Signed-off-by: Lital Gilboa <lital.gilboa@sap.com>
i501378 authored and kittaakos committed Mar 19, 2020
1 parent 73bd544 commit 5fb75c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/mini-browser/src/node/mini-browser-endpoint.ts
Original file line number Diff line number Diff line change
@@ -180,9 +180,10 @@ export class MiniBrowserEndpoint implements BackendApplicationContribution, Mini
const mimeType = lookup(FileUri.fsPath(stat.uri));
if (!mimeType) {
this.logger.warn(`Cannot handle unexpected resource. URI: ${statWithContent.stat.uri}.`);
return response.send();
response.contentType('application/octet-stream');
} else {
response.contentType(mimeType);
}
response.contentType(mimeType);
return response.send(content);
};
}

0 comments on commit 5fb75c7

Please sign in to comment.