Skip to content

empty body on GET responses that Upgrade #333

@doriantaylor

Description

@doriantaylor

Currently using em-http 1.1.5 to write something to rip through and harvest metadata from a bunch of links and it silently failed on one of them (hi @aristus), so I broke it out into a copy of the getting started example to see it would replicate:

require 'eventmachine'
require 'em-http'

EventMachine.run {
  http = EventMachine::HttpRequest.new('http://carlos.bueno.org/about.html').get

  http.errback { p 'Uh oh'; EM.stop }
  http.callback {
    p http.response_header.status
    p http.response
    
    EventMachine.stop
  }
}

Sure enough it does; it returns:

200
""

Wireshark says the data goes over the connection as expected. Response headers are

HTTP/1.1 200 OK
Date: Sat, 15 Jun 2019 00:39:56 GMT
Server: Apache
Upgrade: h2
Connection: Upgrade, close
Last-Modified: Fri, 13 May 2016 00:27:58 GMT
ETag: "10d4-532ae58bc7f80"
Accept-Ranges: bytes
Content-Length: 4308
Vary: Accept-Encoding
Content-Type: text/html

The only thing slightly unusual is the Upgrade header and Connection: Upgrade, close, which seems to replicate an empty body when I enable mod_http2 on my own Apache. Not sure where to look for a diagnosis, but again this is 1.1.5.

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