question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

res._removedHeader does not exists

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Sep 26, 2016

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 😃

0reactions
gr2mcommented, Sep 13, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found