Skip to content

Instantly share code, notes, and snippets.

@tawus
tawus / byte_range.file.clj
Last active December 11, 2023 13:51
byte range aware file-response for ring
(ns byte-range.file
(:require [ring.util.response :as ring-resp :refer
[header status get-header content-type]]
[ring.util.time :refer [parse-date format-date]]
[ring.util.request :as request]
[ring.util.codec :as codec]
[pantomime.mime :refer [mime-type-of]]
[clojure.string :as str]
[clojure.java.io :as io])
(:import [java.io RandomAccessFile]