Commit eb0de8ff authored by nanahira's avatar nanahira

fix

parent 6d331f7a
Pipeline #40992 passed with stages
in 3 minutes and 17 seconds
......@@ -83,9 +83,13 @@ export class UpdateController {
@Query(new ValidationPipe({ transform: true })) depot: DepotDto,
@Param('version') version: string
) {
const checksum = await this.updateService.getChecksum(id, depot, version);
const checksumText = checksum.files.map((f) => `${f.hash} ${f.name}`).join('\n') + '\n';
await stableSend(req, res, checksumText, 'public, max-age=31536000, immutable', 'text/plain; charset=utf-8');
await stableSend(
req,
res,
this.updateService.getChecksum(id, depot, version),
'public, max-age=31536000, immutable',
'text/plain; charset=utf-8'
);
return;
}
......
......@@ -136,11 +136,11 @@ export class UpdateService extends ConsoleLogger {
async getChecksum(id: string, depotDto: DepotDto, version: string) {
const build = await this.getBuild(id, depotDto, version, (qb) => qb.select('build.checksum'));
return {
files: Object.entries(build.checksum)
// .filter(([name, hash]) => file.length && hash !== null)
.map(([name, hash]) => ({ name, hash })),
};
return (
Object.entries(build.checksum)
.map(([name, hash]) => `${hash} ${name}`)
.join('\n') + '\n'
);
}
private async prepareUrl(archives: Archive[], ip: string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment