Commit e695fdd1 authored by Eric Timmons's avatar Eric Timmons

Fix HTTP object store handling of 404s

404s weren't previously caught when a HEAD was bypassed. Additionally, ensure
the stream gets closed on errors to prevent fd leaks.
parent f42bf48a
......@@ -92,8 +92,18 @@
:additional-headers headers
:want-stream t
:force-binary binary-p)
(when (>= code 400)
(when (= code 404)
(ecase if-does-not-exist
((nil)
(signal 'object-missing :store object-store :path path)
(close s)
(return-from open-object-stream nil))
(:error
(close s)
(cerror "Continue" 'object-missing :store object-store :path path))))
(when (and (>= code 400) (/= code 404))
;; Something funky has happened..
(close s)
(error "Unknown error!"))
(when (and offset (not (equal accept-ranges "bytes")))
;; Server doesn't support requesting ranges. We have to forward the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment