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 { ...@@ -83,9 +83,13 @@ export class UpdateController {
@Query(new ValidationPipe({ transform: true })) depot: DepotDto, @Query(new ValidationPipe({ transform: true })) depot: DepotDto,
@Param('version') version: string @Param('version') version: string
) { ) {
const checksum = await this.updateService.getChecksum(id, depot, version); await stableSend(
const checksumText = checksum.files.map((f) => `${f.hash} ${f.name}`).join('\n') + '\n'; req,
await stableSend(req, res, checksumText, 'public, max-age=31536000, immutable', 'text/plain; charset=utf-8'); res,
this.updateService.getChecksum(id, depot, version),
'public, max-age=31536000, immutable',
'text/plain; charset=utf-8'
);
return; return;
} }
......
...@@ -136,11 +136,11 @@ export class UpdateService extends ConsoleLogger { ...@@ -136,11 +136,11 @@ export class UpdateService extends ConsoleLogger {
async getChecksum(id: string, depotDto: DepotDto, version: string) { async getChecksum(id: string, depotDto: DepotDto, version: string) {
const build = await this.getBuild(id, depotDto, version, (qb) => qb.select('build.checksum')); const build = await this.getBuild(id, depotDto, version, (qb) => qb.select('build.checksum'));
return { return (
files: Object.entries(build.checksum) Object.entries(build.checksum)
// .filter(([name, hash]) => file.length && hash !== null) .map(([name, hash]) => `${hash} ${name}`)
.map(([name, hash]) => ({ name, hash })), .join('\n') + '\n'
}; );
} }
private async prepareUrl(archives: Archive[], ip: string) { 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