Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider dropping commons-codec lib in favor of java.util.Base64 #26

Closed
borkdude opened this issue Mar 3, 2021 · 3 comments
Closed

Comments

@borkdude
Copy link
Contributor

borkdude commented Mar 3, 2021

The java.util.Base64 class comes with Java 8. Java 7 is no longer publicly supported. I think it would be safe to replace the commons-codec dependency with pure Java: this library only uses it for base64 encoding/decoding.

This has an additional benefit: this library will become compatible with babashka:

(require '[babashka.deps :as deps]
         '[org.httpkit.server :as server])

(deps/add-deps '{:deps {ring/ring {:mvn/version "1.9.0"}
                        ring/ring-codec {:git/url "https://github.com/borkdude/ring-codec"
                                         :sha "5142b1334e1a8a2e5b1a88759b0746c77e33a0b8"
                                         :deps/manifest :deps}}})

(require '[ring.middleware.params :as p])

(server/run-server (p/wrap-params
                    (fn [req]
                      {:body (:query-params req)}))
                   {:port 8090})

@(promise)
http://localhost:8090/?q=1&q=2
;; =>
["q" ["1" "2"]]

I have already applied this change at a fork here: https://github.com/borkdude/ring-codec
and all the tests are passing.

Let me know if you want to receive a PR.

@weavejester
Copy link
Member

This seems reasonable. I'd happily accept a PR.

@devurandom
Copy link

#27 is merged. Should this issue be closed?

@borkdude
Copy link
Contributor Author

Thanks for pinging me @devurandom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants