diff --git a/ROADMAP.md b/ROADMAP.md
index 5a2f95c15..ad684ecb7 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -45,9 +45,6 @@ the halt tuple. The error tuple will therefore be removed.
### Hooks
-The `onrequest` hook will be removed. It can easily be replaced
-by a middleware.
-
The interface of the `onresponse` hook will change. There has
been a number of issues and added complexity with the current
interface that warrant fixing. The main problem is that the
diff --git a/doc/src/guide/hooks.ezdoc b/doc/src/guide/hooks.ezdoc
index e835a6f97..1c1964884 100644
--- a/doc/src/guide/hooks.ezdoc
+++ b/doc/src/guide/hooks.ezdoc
@@ -1,45 +1,7 @@
::: Hooks
-Cowboy provides two hooks. `onrequest` is called once the request
-line and headers have been received. `onresponse` is called just
-before sending the response.
-
-:: Onrequest
-
-The `onrequest` hook is called as soon as Cowboy finishes fetching
-the request headers. It occurs before any other processing, including
-routing. It can be used to perform any modification needed on the
-request object before continuing with the processing. If a reply is
-sent inside this hook, then Cowboy will move on to the next request,
-skipping any subsequent handling.
-
-This hook is a function that takes a request object as argument,
-and returns a request object. This function MUST NOT crash. Cowboy
-will not send any reply if a crash occurs in this function.
-
-You can specify the `onrequest` hook when creating the listener,
-inside the request options.
-
-``` erlang
-cowboy:start_http(my_http_listener, 100,
- [{port, 8080}],
- [
- {env, [{dispatch, Dispatch}]},
- {onrequest, fun ?MODULE:debug_hook/1}
- ]
-).
-```
-
-The following hook function prints the request object everytime a
-request is received. This can be useful for debugging, for example.
-
-``` erlang
-debug_hook(Req) ->
- erlang:display(Req),
- Req.
-```
-
-Make sure to always return the last request object obtained.
+Hooks allow the user to customize Cowboy's behavior during specific
+operations.
:: Onresponse
@@ -48,9 +10,9 @@ to the socket. It can be used for the purposes of logging responses,
or for modifying the response headers or body. The best example is
providing custom error pages.
-Note that like the `onrequest` hook, this function MUST NOT crash.
-Cowboy may or may not send a reply if this function crashes. If a reply
-is sent, the hook MUST explicitly provide all headers that are needed.
+Note that this function MUST NOT crash. Cowboy may or may not send a
+reply if this function crashes. If a reply is sent, the hook MUST
+explicitly provide all headers that are needed.
You can specify the `onresponse` hook when creating the listener.
diff --git a/doc/src/guide/http_req_resp.png b/doc/src/guide/http_req_resp.png
index e38935f3e..8c9cae994 100644
Binary files a/doc/src/guide/http_req_resp.png and b/doc/src/guide/http_req_resp.png differ
diff --git a/doc/src/guide/http_req_resp.svg b/doc/src/guide/http_req_resp.svg
index 0cfa0ae99..d1e7f784c 100644
--- a/doc/src/guide/http_req_resp.svg
+++ b/doc/src/guide/http_req_resp.svg
@@ -65,15 +65,15 @@
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
- inkscape:cx="229.71447"
+ inkscape:cx="82.28271"
inkscape:cy="764.83183"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="1920"
- inkscape:window-height="1014"
+ inkscape:window-width="2560"
+ inkscape:window-height="1402"
inkscape:window-x="0"
- inkscape:window-y="33"
+ inkscape:window-y="38"
inkscape:window-maximized="1"
inkscape:snap-global="true"
showguides="true">
@@ -93,7 +93,7 @@
image/svg+xml
-
+
@@ -101,42 +101,28 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
-
-
-
+
+ inkscape:export-filename="/home/essen/extend/cowboy/guide/http_req_resp.png"
+ inkscape:connector-curvature="0"
+ id="use5777"
+ d="m 178.49877,231.1517 203.00246,0.045"
+ style="fill:none;stroke:#6d8e41;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1.99999999, 3.99999998;stroke-dashoffset:0" />
-
-
+ transform="translate(205.03261,-207.5)">
+
+
+
-
-
+ style="fill:#d1f2a5;fill-opacity:1;fill-rule:nonzero;stroke:#a9ca7d;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />