From b91291ce9af74da12ce770d2e858538933de6b5f Mon Sep 17 00:00:00 2001 From: Shoji KUMAGAI Date: Wed, 6 Feb 2013 12:21:27 +0900 Subject: [PATCH] fix mochiweb_response regression --- src/mochiweb_response.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mochiweb_response.erl b/src/mochiweb_response.erl index 0aaa7cca..c2a94d9e 100644 --- a/src/mochiweb_response.erl +++ b/src/mochiweb_response.erl @@ -43,19 +43,19 @@ dump({?MODULE, [Request, Code, Headers]}) -> %% @spec send(iodata(), response()) -> ok %% @doc Send data over the socket if the method is not HEAD. -send(Data, {?MODULE, [Request, _Code, _Headers]}=THIS) -> - case Request:get(method, THIS) of +send(Data, {?MODULE, [Request, _Code, _Headers]}) -> + case Request:get(method) of 'HEAD' -> ok; _ -> - Request:send(Data, THIS) + Request:send(Data) end. %% @spec write_chunk(iodata(), response()) -> ok %% @doc Write a chunk of a HTTP chunked response. If Data is zero length, %% then the chunked response will be finished. write_chunk(Data, {?MODULE, [Request, _Code, _Headers]}=THIS) -> - case Request:get(version, THIS) of + case Request:get(version) of Version when Version >= {1, 1} -> Length = iolist_size(Data), send([io_lib:format("~.16b\r\n", [Length]), Data, <<"\r\n">>], THIS);