mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
The headers were forwarded to the serverless function for "internal" images but not "external" images. This changes the behavior to be the same for both such that neither receive headers.
12 lines
345 B
JavaScript
12 lines
345 B
JavaScript
const pixel =
|
|
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=='
|
|
|
|
export default function handler(req, res) {
|
|
if (req.headers['cookie']) {
|
|
res.setHeader('content-type', 'image/png')
|
|
res.end(Buffer.from(pixel, 'base64'))
|
|
} else {
|
|
res.status(401).end('cookie was not found')
|
|
}
|
|
}
|