aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--guide/toc.md3
-rw-r--r--src/cowboy_req.erl6
-rw-r--r--src/cowboy_rest.erl5
4 files changed, 10 insertions, 10 deletions
diff --git a/README.md b/README.md
index 4ff5ea4..826f271 100644
--- a/README.md
+++ b/README.md
@@ -21,9 +21,9 @@ No parameterized module. No process dictionary. **Clean** Erlang code.
Quick start
-----------
- * Add Cowboy as a rebar dependency to your application.
- * Start Cowboy and add one or more listeners.
- * Write handlers for your application.
+ * Add Cowboy as a rebar dependency to your application
+ * Start Cowboy and add one or more listeners
+ * Write handlers for your application
Getting Started
---------------
diff --git a/guide/toc.md b/guide/toc.md
index ea543d1..b57b92e 100644
--- a/guide/toc.md
+++ b/guide/toc.md
@@ -8,9 +8,10 @@ Cowboy User Guide
* Getting started
* Routing
* Purpose
- * Dispatch rule
+ * Dispatch list
* Match rules
* Bindings
+ * Constraints
* Handlers
* Purpose
* Protocol upgrades
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 3426dbc..2d45a59 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -183,15 +183,13 @@ new(Socket, Transport, Method, Path, Query, Fragment,
method=Method, path=Path, qs=Query, fragment=Fragment, version=Version,
headers=Headers, host=Host, port=Port, buffer=Buffer,
onresponse=OnResponse},
- case CanKeepalive of
+ case CanKeepalive and (Version =:= {1, 1}) of
false ->
Req#http_req{connection=close};
true ->
case lists:keyfind(<<"connection">>, 1, Headers) of
- false when Version =:= {1, 1} ->
- Req; %% keepalive
false ->
- Req#http_req{connection=close};
+ Req; %% keepalive
{_, ConnectionHeader} ->
Tokens = parse_connection_before(ConnectionHeader, []),
Connection = connection_to_atom(Tokens),
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index 1c0554a..bc14d35 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -195,8 +195,9 @@ options(Req, State) ->
%%
%% Note that it is also possible to return a binary content type that will
%% then be parsed by Cowboy. However note that while this may make your
-%% resources a little more readable, this is a lot less efficient. An example
-%% of such a return value would be:
+%% resources a little more readable, this is a lot less efficient.
+%%
+%% An example of such return value would be:
%% {<<"text/html">>, to_html}
content_types_provided(Req, State) ->
case call(Req, State, content_types_provided) of