Skip to content

Commit 7efeefa

Browse files
authored
Slight language changes for clarity
Technically, `HTTP/1.1` looks valid, so I made it more explicitly incorrect. And it doesn't check the version itself, just the format; using `HTTP/3.14159` works, when it shouldn't!
1 parent 725552d commit 7efeefa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/aleph/http_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
(apply d/zip)
248248
deref))))
249249

250-
(deftest test-overly-long-request
250+
(deftest test-overly-long-url
251251
(let [long-url (apply str "http://localhost:" port "/" (repeat 1e4 "a"))]
252252
(with-handler basic-handler
253253
(is (= 414 (:status @(http-get long-url)))))))
@@ -259,10 +259,10 @@
259259
(with-handler basic-handler
260260
(is (= 431 (:status @(http-get url opts)))))))
261261

262-
(deftest test-invalid-http-version
262+
(deftest test-invalid-http-version-format
263263
(with-handler basic-handler
264264
(let [client @(tcp/client {:host "localhost" :port port})
265-
_ @(s/put! client "GET / HTTP/1.1 INVALID\r\n\r\n")
265+
_ @(s/put! client "GET / HTTP-1,1\r\n\r\n")
266266
response (bs/to-string @(s/take! client))]
267267
(is (str/starts-with? response "HTTP/1.1 400"))
268268
(s/close! client))))

0 commit comments

Comments
 (0)