                 'X-Content-Type-Options' : 'nosniff'
 
               srcResp.on 'end', ->
-                decr()
-                resp.end()
+                finish resp
 
               srcResp.on 'error', ->
-                decr()
-                resp.end()
+                finish resp
 
               switch srcResp.statusCode
                 when 200
                   if newHeaders['content-type'] && newHeaders['content-type'].slice(0, 5) != 'image'
-                    four_oh_four("Non-Image content-type returned")
+                    four_oh_four(resp, "Non-Image content-type returned")
 
                   log newHeaders
 


        if url.host? && !url.host.match(RESTRICTED_IPS)
          if url.host.match(EXCLUDED_HOSTS)
            return four_oh_four("Hitting excluded hostnames")

          src = Http.createClient url.port || 80, url.hostname

          src.on 'error', (error) ->
            four_oh_four("Client Request error #{error.stack}")

          query_path = url.pathname
          if url.query?

    total_connections   += 1
    current_connections += 1
    url = Url.parse req.url

    transferred_headers =
      'Via'                    : process.env.CAMO_HEADER_VIA or= "Camo Asset Proxy #{version}"
