<commit_before>(ns io.aviso.rook.jetty-async-adapter
  "A wrapper around ring.adapter.jetty which makes use of Jetty Continuations linked to core.async channels."
  (:import (org.eclipse.jetty.server Server Request)
           (org.eclipse.jetty.server.handler AbstractHandler)
           (javax.servlet.http HttpServletRequest HttpServletResponse)
           (org.eclipse.jetty.continuation ContinuationSupport Continuation))
  (:require
    [clojure.tools.logging :as l]
    [clojure.core.async :refer [go <! timeout alts! take! close!]]
    [io.aviso.rook.utils :as utils]
    [io.aviso.toolchest.collections :refer [pretty-print pretty-print-brief]]
    [ring.util
     [servlet :as servlet]
     [response :as r]]
    [ring.adapter.jetty :as jetty]))

(defn- customized-proxy-handler
  [handler]
  (proxy [AbstractHandler] []
    (handle [_ ^Request base-request request response]
      (let [request-map (-> (servlet/build-request-map request)
                            ;; The change:
                            (assoc ::http-servlet-request request<commit_msg>Fix up core.async require declaration<commit_after>(ns io.aviso.rook.jetty-async-adapter
  "A wrapper around ring.adapter.jetty which makes use of Jetty Continuations linked to core.async channels."
  (:import (org.eclipse.jetty.server Server Request)
           (org.eclipse.jetty.server.handler AbstractHandler)
           (javax.servlet.http HttpServletRequest HttpServletResponse)
           (org.eclipse.jetty.continuation ContinuationSupport Continuation))
  (:require
    [clojure.tools.logging :as l]
    [clojure.core.async :refer [go timeout alt! close!]]
    [io.aviso.rook.utils :as utils]
    [io.aviso.toolchest.collections :refer [pretty-print pretty-print-brief]]
    [ring.util
     [servlet :as servlet]
     [response :as r]]
    [ring.adapter.jetty :as jetty]))

(defn- customized-proxy-handler
  [handler]
  (proxy [AbstractHandler] []
    (handle [_ ^Request base-request request response]
      (let [request-map (-> (servlet/build-request-map request)
                            ;; The change:
                            (assoc ::http-servlet-request request
{'fraction_non_alphanumeric': 0.11513463324048283, 'fraction_numerical': 0.0, 'mean_word_length': 2.946886446886447, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754141', 'n_tokens_mistral': 644, 'n_tokens_neox': 638, 'n_words': 152}