This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Http-kit code reading | |
HttpException - standard exception | |
DynamicBytes - self expanding byte array | |
HeaderMap - array used as map for speed | |
HttpMethod - enum for methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns util.camelize-dasherize | |
(:import (clojure.lang IPersistentMap Keyword)) | |
(:require [clojure.string :as s] | |
[clojure.zip :as zip])) | |
; TODO: regex is slow, should try iterating the string. | |
(defn dasherize-string | |
"Converts an underscored or camelized string | |
into an dasherized one." | |
[s] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn require-login* | |
"Used to wrap a route handler, checks if 'logged-in?'. If true, allows the handler to run. | |
If false, rejects the user." | |
[success-method fail-method {session :session :as req}] | |
(if (logged-in? session) | |
(apply success-method [req]) | |
(apply fail-method [req]))) | |
(defn- require-login-single-form | |
[fail-method [method path args & body :as form]] |