aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-01-26 22:27:55 +0100
committerLudovic Courtès <ludo@gnu.org>2018-01-26 22:41:22 +0100
commit4558d1c86914e2427fc99afbe00c28cb716dbd3d (patch)
treefa2763f849955a2abf133f99d1de231ad5b117ed /tests
parent8b26874cac35dabb0d4e203e0de8e9c3485738a1 (diff)
downloadcuirass-4558d1c86914e2427fc99afbe00c28cb716dbd3d.tar
cuirass-4558d1c86914e2427fc99afbe00c28cb716dbd3d.tar.gz
http: Reject methods other than GET.
* src/cuirass/http.scm (url-handler): Check whether REQUEST's method is 'GET, and return 405 if not.
Diffstat (limited to 'tests')
-rw-r--r--tests/http.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/http.scm b/tests/http.scm
index 6dd48a3..1e1f754 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -195,6 +195,10 @@
(object->json-string build-query-result)
json->scm)))
+ (test-equal "POST /build/1"
+ 405 ;Method Not Allowed
+ (response-code (http-post (test-cuirass-uri "/build/1"))))
+
(test-equal "/build/1/log/raw"
`(302 ,(string->uri-reference "/log/fake-1.0"))
(let ((response (http-get (test-cuirass-uri "/build/1/log/raw"))))