res._removedHeader does not exists
See original GitHub issueI got this error:
TypeError: Cannot set property 'content-length' of undefined
at ServerResponse.OutgoingMessage.removeHeader (_http_outgoing.js:388:30)
at ServerResponse.onResponseHeaders (/home/imbolc/0/p/action-loop/node_modules/compression/index.js:202:13)
at ServerResponse.writeHead (/home/imbolc/0/p/action-loop/node_modules/on-headers/index.js:46:16)
at ServerResponse._implicitHeader (_http_server.js:157:8)
at ServerResponse.write (/home/imbolc/0/p/action-loop/node_modules/compression/index.js:83:14)
at /home/imbolc/0/p/action-loop/node_modules/express-pouchdb/lib/routes/changes.js:64:17
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
I just fix this with monkey patching of compression/index.js
:
// header fields
res.setHeader('Content-Encoding', method)
try {
res.removeHeader('Content-Length')
} catch (e) {
console.log(e)
if (res._removedHeader === undefined) {
res._removedHeader = {};
}
res.removeHeader('Content-Length')
}
Do you have any ideas why does it happen and what the right way to fix this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
res.getHeader function does not exist · Issue #117 · pillarjs/send
I'm wondering if this module is not up to date? ... States: res.set('Content-Type', 'text/html'); . Same goes for koajs. Can't see any getHeader ......
Read more >angularjs - `node` api getting error on `post` - body param being as ...
I have removed header from $http request, and it works fine. my code with issue is : with header vm.createNewFamily = function() {...
Read more >MimeHeaders.java - Apache Nightlies Distribution Directory
import org.apache.tomcat.util.res. ... (and should not) exist more than once in a header. ... This is based on the fact that most servlets...
Read more >TCG TSS 2.0 System Level API (SAPI) Specification
command doesn't take authorizations. •. Added text to _Prepare call that it sets the tag for no sessions. •. Added changes from review....
Read more >https://r-forge.r-project.org/scm/viewvc.php/*chec...
R source code\n") } else { cat("Error: matrix has no column names and default ... row at bottom will show samples excluded only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, thanks for the heads-up, @gr2m ! I see that PR was merged as well. It sounds like I can close this issue. Let me know if I should re-open for any reason 😃
this is not a compression issue, sorry for the noise 😃 I resolved the problem that Hoodie had via https://github.com/hoodiehq/hoodie-store-server/pull/60
Thanks for your great work, @dougwilson 👋 I think we can close this issue