               (String. (get-bytes part) offset (- (alength (get-bytes part)) offset))))})
 
 (defn assoc-body-parameters [ctx parts-by-name schemas]
-  (let [coercion-matchers (get-in ctx [:resource :methods (:method ctx)
-                                       :coercion-matchers])
+  (let [coercion-matchers (get-in ctx [:resource :methods (:method ctx) :coercion-matchers])
         matcher (or (:form coercion-matchers) (:body coercion-matchers))
         coercer (sc/coercer
                  (or (:form schemas) (:body schemas))

        (System/arraycopy source from b 0 len)
        b))))

(defn- count-transport-padding [from to b]
  (loop [n from]
    (when (< n to)
      (let [x (get b n)]
        ;; RFC 822 Section 3.3: LWSP-char = SPACE (32) / HTAB (9)
        (if-not (#{(byte \tab) (byte \space)} x)
          (if (and (= (get b n) (byte \return))
                   (= (get b (inc n)) (byte \newline)))
            (+ (count [\return \newline]) n)
            ;; try to trigger this via a test
            (throw (ex-info "Malformed boundary" {:from from
                                                  :to to
                                                  :n n
                                                  :c1 (char (get b n))
                                                  :c2 (char (get b (inc n)))})))
          (recur (inc n)))))))

(defn- copy-bytes-after-dash-boundary [{:keys [window dash-boundary-size]} from to]
  (copy-bytes window (count-transport-padding (+ from dash-boundary-size) to window) to))

                    ((or coercion-matchers default-part-coercion-matcher) schema)
                    ((rsc/coercer :json) schema))))
        params (coercer parts-by-name)]
    (if (and (= 1 (count parts-by-name))
               (nil? (ffirst parts-by-name)))
        ctx
        (if-not (schema.utils/error? params)
          (assoc-in ctx [:parameters (if (:form schemas) :form :body)] params)
          (d/error-deferred (ex-info "Bad form fields"
                                     {:status 400 :error (schema.utils/error-val params)}))))))

(defmethod process-request-body "multipart/form-data"
  [ctx body-stream media-type & args]
