diff options
| author | Drahflow <drahflow@gmx.de> | 2017-02-08 23:42:21 +0100 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2017-02-08 23:42:21 +0100 |
| commit | 6bbf9de55354e7f02c251699244b1a8054ae68a6 (patch) | |
| tree | 6bab67a43406278bff14592246503da2e095e6c8 /elymas | |
| parent | 60437de881b9aa9654d200f4bb4aa532a214b41b (diff) | |
Allow HTTP response headers
Diffstat (limited to 'elymas')
| -rw-r--r-- | elymas/lib/net/alg/http.ey | 10 |
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 |
