From c7069e7fb90470929bce9757615b317f409b205d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 14 May 2011 18:46:50 +0200 Subject: Add the Server header in the HTTP replies. --- src/cowboy_http_req.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl index 0956022..875a6dd 100644 --- a/src/cowboy_http_req.erl +++ b/src/cowboy_http_req.erl @@ -188,7 +188,8 @@ reply(Code, Headers, Body, Req=#http_req{socket=Socket, {<<"Connection">>, atom_to_connection(Connection)}, {<<"Content-Length">>, list_to_binary(integer_to_list(iolist_size(Body)))}, - {<<"Date">>, cowboy_clock:rfc1123()} + {<<"Date">>, cowboy_clock:rfc1123()}, + {<<"Server">>, <<"Cowboy">>} ]), Transport:send(Socket, [Head, Body]), {ok, Req#http_req{resp_state=done}}. @@ -200,7 +201,8 @@ chunked_reply(Code, Headers, Req=#http_req{socket=Socket, transport=Transport, Head = response_head(Code, Headers, [ {<<"Connection">>, <<"close">>}, {<<"Transfer-Encoding">>, <<"chunked">>}, - {<<"Date">>, cowboy_clock:rfc1123()} + {<<"Date">>, cowboy_clock:rfc1123()}, + {<<"Server">>, <<"Cowboy">>} ]), Transport:send(Socket, Head), {ok, Req#http_req{resp_state=chunks}}. -- cgit v1.2.3