diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index c1fb16c..6e8fd16 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -30,8 +30,7 @@ defmodule HTTPd do
if (type(request.method) == Str) do
response = error_405_page(request)
else
- router = route_request(request)
- response = router(request)
+ response = route_and_render_request(request)
end
response = HTTP.Response.set_header(response,
"Connection", "Keep-Alive")
@@ -208,18 +207,19 @@ defmodule HTTPd do
def HTTPd.routes = tmp
}
- def route_request = fn {
+ def route_and_render_request = fn {
(request) {
- route_request(request, routes)
+ route_and_render_request(request, routes)
}
(request, []) {
- error_404_page
+ error_404_page(request)
}
(request, [route | next_routes]) {
- if (controller = HTTPd.Route.match(route, request)) do
- controller
+ if ((controller = HTTPd.Route.match(route, request)) &&
+ (response = controller(request)))
+ response
else
- route_request(request, next_routes)
+ route_and_render_request(request, next_routes)
end
}
}
diff --git a/test/httpd/static/favicon.ico b/test/httpd/static/favicon.ico
new file mode 100644
index 0000000..07add71
Binary files /dev/null and b/test/httpd/static/favicon.ico differ
diff --git a/test/ikc3/equal.kc3 b/test/ikc3/equal.kc3
index 80ffcea..ef41d93 100644
--- a/test/ikc3/equal.kc3
+++ b/test/ikc3/equal.kc3
@@ -10,3 +10,7 @@ quote {1, 2} = {f, g}
{1, 2} = {f, g}
quote ? = 1
? = 1
+quote to_lisp(quote a = 1 && b = 2)
+to_lisp(quote a = 1 && b = 2)
+quote if (a = 1 && b = 2) do {a, b} end
+if (a = 1 && b = 2) do {a, b} end