/files/:key/*を301 redirectに

This commit is contained in:
tamaina 2024-02-12 15:53:44 +00:00
parent b15d85076c
commit cab7ee18d6
1 changed files with 1 additions and 2 deletions

View File

@ -82,8 +82,7 @@ export class FileServerService {
.catch(err => this.errorHandler(request, reply, err)); .catch(err => this.errorHandler(request, reply, err));
}); });
fastify.get<{ Params: { key: string; } }>('/files/:key/*', async (request, reply) => { fastify.get<{ Params: { key: string; } }>('/files/:key/*', async (request, reply) => {
return await this.sendDriveFile(request, reply) return await reply.redirect(301, `${this.config.url}/files/${request.params.key}`);
.catch(err => this.errorHandler(request, reply, err));
}); });
done(); done();
}); });