mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
de271780fc
commit
9f68adf230
2 changed files with 3 additions and 3 deletions
|
@ -49,7 +49,7 @@ export const GitServiceDefinition = {
|
|||
request: {} as FileLocation,
|
||||
response: {} as {
|
||||
isBinary: boolean;
|
||||
content: string;
|
||||
content: Buffer;
|
||||
},
|
||||
},
|
||||
history: {
|
||||
|
@ -140,7 +140,7 @@ export const getGitServiceHandler = (
|
|||
const isBinary = blob.isBinary();
|
||||
return {
|
||||
isBinary,
|
||||
content: blob.content().toString(),
|
||||
content: blob.content(),
|
||||
};
|
||||
},
|
||||
async history({ uri, path, revision, count, after }) {
|
||||
|
|
|
@ -133,7 +133,7 @@ export function fileRoute(router: CodeServerRouter, codeServices: CodeServices)
|
|||
try {
|
||||
const blob = await gitService.raw(endpoint, { uri: repoUri, path, revision });
|
||||
if (blob.isBinary) {
|
||||
return h.response(blob.content).type('application/octet-stream');
|
||||
return h.response(blob.content).encoding('binary');
|
||||
} else {
|
||||
return h.response(blob.content).type('text/plain');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue