HTTP Range middleware for the Clojure Ring server
Given a response body and a valid Range header, this middleware fulfills the request's Range header. It works for bodies where the content length is either known or unknown, but uses way less memory when it's known.
The middleware looks for the following to determine the content length:
Otherwise, this middleware has to buffer the body. There is an option for buffer size you can give to the handler.
You can use it like normal Ring middleware.
(require [ring-range-middleware.core :as range-middleware])
...
(-> your-handler
...
(range-middleware/wrap-range-header)
...)
You can use the handler with options.
(-> your-handler
...
(range-middleware/wrap-range-header opts)
...)
opts
is a map with the following keys:
MIT
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close