Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ring-core/src/ring/util/request.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"://"
(get-in request [:headers "host"])
(:uri request)
(when-let [query (:query-string request)]
(when-let [query (not-empty (:query-string request))]
(str "?" query))))

(defn content-type
Expand Down
5 changes: 5 additions & 0 deletions ring-core/test/ring/util/test/request.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
(is (= (request-url {:scheme :https
:uri "/index.html"
:headers {"host" "www.example.com"}})
"https://www.example.com/index.html"))
(is (= (request-url {:scheme :https
:uri "/index.html"
:headers {"host" "www.example.com"}
:query-string ""})
"https://www.example.com/index.html")))

(deftest test-content-type
Expand Down
Loading