Skip to content

Commit 0610a79

Browse files
authored
Update index.ts
1 parent 2a0b981 commit 0610a79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { getScreenshot } from './_lib/chromium';
44
module.exports = async (req: NowRequest, res: NowResponse) => {
55
try {
66
const file = await getScreenshot(req.query.url, req.query.width, req.query.height);
7-
res.header('Content-Type', `image/png`);
8-
res.header('Cache-Control', `public, immutable, no-transform, s-maxage=31536000, max-age=31536000`);
7+
res.setHeader('Content-Type', `image/png`);
8+
res.setHeader('Cache-Control', `public, immutable, no-transform, s-maxage=31536000, max-age=31536000`);
99
res.status(200).end(file);
1010
} catch (error) {
11-
res.header('Content-Type', 'application/json');
11+
res.setHeader('Content-Type', 'application/json');
1212
res.json({
1313
"success": false,
1414
"error": "No url query",

0 commit comments

Comments
 (0)