Reading images in HTTP doesn't seem to terminate

I think I get it. I need to send a response like this so it will terminate

using HTTP

using Colors

# initialize to nothing
orig_img = nothing

using ImageMagick
HTTP.listen() do http::HTTP.Stream
    global orig_img
    @show http.message
    @show HTTP.header(http, "Content-Type")
    while !eof(http)
        orig_img = ImageMagick.readblob( readavailable(http))
    end

    HTTP.setstatus(http, 404)
    HTTP.setheader(http, "Foo-Header" => "bar")
    HTTP.startwrite(http)
    write(http, "response body")
    write(http, "more response body")
end

orig_img