nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71a2ad4
)
lib/nitcorn: extract `HttpServer::respond`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Sat, 7 Nov 2015 17:27:32 +0000
(12:27 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 10 Nov 2015 20:24:08 +0000
(15:24 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/nitcorn/reactor.nit
patch
|
blob
|
history
diff --git
a/lib/nitcorn/reactor.nit
b/lib/nitcorn/reactor.nit
index
4b13677
..
4d8cdfe
100644
(file)
--- a/
lib/nitcorn/reactor.nit
+++ b/
lib/nitcorn/reactor.nit
@@
-83,11
+83,15
@@
class HttpServer
else response = new HttpResponse(405)
else response = new HttpResponse(405)
- # Send back a response
+ respond response
+ close
+ end
+
+ # Send back `response` to the client
+ fun respond(response: HttpResponse)
+ do
write response.to_s
for path in response.files do write_file path
-
- close
end
end