Skip to content

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client #4

Description

@ghazel
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
     at ServerResponse.setHeader (_http_outgoing.js:482:11)
     at vary (/myproj/node_modules/vary/index.js:147:9)
     at send (/myproj/node_modules/webp-middleware/index.js:24:3)
     at sendAndSave (/myproj/node_modules/webp-middleware/index.js:30:3)
     at /myproj/node_modules/webp-middleware/index.js:84:3
     at suppressedCallback (fs.js:205:5)
     at FSReqCallback.args [as oncomplete] (fs.js:146:20)

Looking at the headers around error time, Vary has already been set:

{
'x-powered-by': 'Express',
vary: 'Accept',
'accept-ranges': 'bytes',
'cache-control': 'public, max-age=0',
'last-modified': 'Tue, 05 Feb 2019 03:48:14 GMT',
etag: 'W/"1319a-168bbc5443a"',
'content-type': 'image/webp',
'content-length': 78234
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions