nodegit: 5.6.0 https url: [Error: HTTP parser error: unexpected content-length header]

With node 5.6.0 which fixes https parsing errors and changes current parsing behavior (https://nodejs.org/en/blog/vulnerability/february-2016-security-releases) trying to git clone or rebase https bitbucket private url results in

[Error: HTTP parser error: unexpected content-length header]

standard clone example will reproduce this error

 nodegit.Clone(
// basic auth bitbucket repo is what I was testing
    "https://user:pass@bitbucket.org/repo.git",
    path,
    {
      fetchOpts: {
        callbacks: {
          certificateCheck: function() {
            // github will fail cert check on some OSX machines
            // this overrides that check
            return 1;
          }
        }
      }
    })

node 5.5.0 works as expected

this seems like an error from http-parser itself so I don’t know if this is really related to nodegit, since I’m very short on time to do some more debugging

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

FWIW, I submitted a ticket to Atlassian and received:

Jesse Yowell [Atlassian] 26/Apr/16 9:22 PM

Alvin, This is somewhat of a double-edged sword at the moment, so we’re confirming with another team. The reason we’re using this content-length header response is for integration with our Bamboo Cloud product. I’ve heard it’s fairly easy to ditch the extra header, but we want to be sure it won’t break functionality with our other product before doing so. Thanks, Jesse


Re: API call for PUSH returning non-RFC response WAITING FOR CUSTOMER

Please add any details that might help us help you. As documented below, the invalid response from bitbucket is breaking node’s core http-parser module. https://github.com/nodejs/http-parser/issues/289 (details on what’s specifically breaking for my application) https://github.com/nodegit/nodegit/issues/911

Jesse at bitbucket got back to me – It’s fixed now… at least for my use-case.