Commit f9cf157b authored by nanahira's avatar nanahira

inline

parent 3e3095d5
Pipeline #8571 passed with stages
in 3 minutes and 34 seconds
......@@ -16,7 +16,7 @@ export class AppController {
@Get('user_avatar/ygobbs.com/:username/:size/:filename.png')
@Header('Cache-Control', 'public, max-age=600')
@Header('Content-Type', 'image/png')
// @Header('Content-Type', 'image/png')
@ApiOperation({ summary: '获取裁剪后的用户头像' })
@ApiParam({ name: 'username', description: '用户名' })
@ApiParam({ name: 'size', description: '头像尺寸', type: 'number' })
......@@ -29,6 +29,9 @@ export class AppController {
throw new BlankReturnMessageDto(400, 'Invalid size');
}
const buffer = await this.appService.getImage(username, size);
return new StreamableFile(buffer);
return new StreamableFile(buffer, {
type: 'image/png',
disposition: 'inline',
});
}
}
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