aboutsummaryrefslogtreecommitdiff
path: root/elymas
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2017-02-08 23:42:21 +0100
committerDrahflow <drahflow@gmx.de>2017-02-08 23:42:21 +0100
commit6bbf9de55354e7f02c251699244b1a8054ae68a6 (patch)
tree6bab67a43406278bff14592246503da2e095e6c8 /elymas
parent60437de881b9aa9654d200f4bb4aa532a214b41b (diff)
Allow HTTP response headers
Diffstat (limited to 'elymas')
-rw-r--r--elymas/lib/net/alg/http.ey10
1 files changed, 8 insertions, 2 deletions
diff --git a/elymas/lib/net/alg/http.ey b/elymas/lib/net/alg/http.ey
index c6a9026..4a407e5 100644
--- a/elymas/lib/net/alg/http.ey
+++ b/elymas/lib/net/alg/http.ey
@@ -18,15 +18,21 @@
{ ":" via "" ==url "" ==method < { defvst }' /put deffst > ==headers "" ==body
{
method url headers body < ==body ==headers ==url ==method
+ [ ] ==outputHeaders
{ :close } =*close
{ :write } =*write
{ :finish } =*finish
{ ==contentType
- "HTTP/1.0 200 Ok\r\nContent-Type: " contentType cat "\r\n\r\n" cat -01 cat :write :finish
+ "HTTP/1.0 200 Ok\r\nContent-Type: " contentType cat "\r\n" cat
+ outputHeaders |cat each
+ "\r\n" cat -01 cat :write :finish
} =*ok
{ ==contentType
- "HTTP/1.0 500 Error\r\nContent-Type: " contentType cat "\r\n\r\n" cat -01 cat :write :finish
+ "HTTP/1.0 500 Error\r\nContent-Type: " contentType cat "\r\n" cat
+ outputHeaders |cat each
+ "\r\n" cat -01 cat :write :finish
} =*fail
+ { [ -01 "\r\n" cat ] outputHeaders -01 cat =outputHeaders } =*addHeader
> ::request
} =*requestParsed